FD900's picture
Create api.py
9cf3d4c verified
raw
history blame
633 Bytes
import requests
API_BASE = "https://gaia-benchmark.vercel.app"
def get_all_questions():
return requests.get(f"{API_BASE}/questions").json()
def get_random_question():
return requests.get(f"{API_BASE}/random-question").json()
def get_file(task_id, filename):
url = f"{API_BASE}/files/{task_id}/{filename}"
r = requests.get(url)
r.raise_for_status()
return r.content
def submit_answers(username, code_link, answers):
payload = {
"username": username,
"agent_code": code_link,
"answers": answers
}
r = requests.post(f"{API_BASE}/submit", json=payload)
return r.json()