DriptoBhattacharyya's picture
GAIA LangGraph agent: Groq + Tavily + LLM-as-judge
cb1b811
Raw
History Blame Contribute Delete
1.07 kB
"""Fetch all GAIA questions, run the agent locally, print answers — DO NOT submit.
Usage (from the template dir, venv active):
python scripts/dry_run.py # all questions
python scripts/dry_run.py 3 # first 3 only
"""
from __future__ import annotations
import sys
import requests
from dotenv import load_dotenv
load_dotenv()
from gaia_agent import GaiaAgent # noqa: E402
from gaia_agent.config import get_settings # noqa: E402
def main(limit: int | None) -> None:
api = get_settings().gaia_api_url
questions = requests.get(f"{api}/questions", timeout=30).json()
if limit:
questions = questions[:limit]
agent = GaiaAgent()
for i, item in enumerate(questions, 1):
tid = item.get("task_id", "")
qtext = item.get("question", "")
answer = agent(qtext, tid)
print(f"\n[{i}/{len(questions)}] task={tid}")
print(f" Q: {qtext[:120]}...")
print(f" A: {answer!r}")
if __name__ == "__main__":
n = int(sys.argv[1]) if len(sys.argv) > 1 else None
main(n)