Spaces:
Sleeping
Sleeping
| import requests | |
| from agent import answer_question | |
| # Get GAIA questions | |
| questions = requests.get("https://api.gaia-course.com/questions").json() | |
| # Format answers | |
| answers = [] | |
| for q in questions: | |
| task_id = q["task_id"] | |
| question = q["question"] | |
| response = answer_question(question) | |
| answers.append({"task_id": task_id, "submitted_answer": response.strip()}) | |
| # Submit answers | |
| submission = { | |
| "username": "your-hf-username", | |
| "agent_code": "https://huggingface.co/spaces/yourname/your-space/tree/main", | |
| "answers": answers | |
| } | |
| submit_response = requests.post("https://api.gaia-course.com/submit", json=submission) | |
| print(submit_response.json()) | |