frsswq/Final_Assignment_Template
0
GAIA Final Assignment Agent (HF Agents Course — Unit 4)
Agent built on the low-cost Gemini 2.5 Flash-Lite model through OpenRouter that answers the 20 GAIA level-1 questions from the course scoring API.
Architecture
agent.py—GaiaAgent: OpenRouter chat completions with Gemini 2.5 Flash-Lite, OpenRouter web search for research questions, and multimodal input for attachments (PNG/MP3 as base64, YouTube links as video URLs, XLSX converted to a markdown table,.pyinlined as text). Answers follow GAIA exact-match formatting rules and are extracted from a finalANSWER:line.run_local.py— runs the agent over all questions fromGET /questions, caching results incrementally toanswers.json(retries only on technical failure).app.py— the original Gradio submission app from the course template (kept for reference; Gradio hosting on free Spaces is no longer available, so answers were generated locally withrun_local.pyand submitted toPOST /submit).answers.json— the agent's cached answers, exactly as submitted.
Configuration
Set OPENROUTER_API_KEY in the environment or a local gitignored .env file. The model can be changed with OPENROUTER_MODEL; it defaults to google/gemini-2.5-flash-lite.
Note: the course API GET /files/{task_id} endpoint was returning 404 for all attachments at the time of the run; the 5 attachment files were fetched from a public mirror instead and fed to the same pipeline.
