feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
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

This commit is contained in:
2026-07-01 13:13:44 +03:00
parent 1c534b07bc
commit 35b6e514a8
5 changed files with 214 additions and 231 deletions
+39
View File
@@ -0,0 +1,39 @@
"""
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()