Files
8.-samopisnyy-poiskovyy-age…/main.py
T
kuzakhmetovartur 35b6e514a8
CI / build (3.1) (push) Has been cancelled
CI / build (3.11) (push) Has been cancelled
CI / build (3.8) (push) Has been cancelled
CI / build (3.9) (push) Has been cancelled
feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
2026-07-01 13:13:44 +03:00

39 lines
782 B
Python

"""
Entry point for the Deep Agents from Scratch search agent.
"""
from __future__ import annotations
import os
import sys
from pathlib import Path
from dotenv import load_dotenv
from src.agent import run_query
# Load environment variables from .env if present
load_dotenv(dotenv_path=Path(".env"))
def main() -> None:
"""
Main function to run the search agent with a user-provided query.
"""
if len(sys.argv) < 2:
print("Usage: python main.py \"Your search query here\"")
sys.exit(1)
query = " ".join(sys.argv[1:])
try:
answer = run_query(query)
except RuntimeError as err:
print(f"Error: {err}")
sys.exit(1)
print("\n=== Agent Response ===")
print(answer)
if __name__ == "__main__":
main()