import requests # CONFIGURA TUS DATOS AQUƍ API_URL = "https:///questions" SUBMIT_URL = "https:///submit" SPACE_URL = "https://huggingface.co/spaces///tree/main" USERNAME = "" # Obtener las preguntas response = requests.get(API_URL) questions = response.json() answers = [] for q in questions: task_id = q["task_id"] task_data = q["question"] # Llamada al agente agent_response = requests.post( "/predict", json={"task_id": task_id, "task_data": task_data} ) submitted_answer = agent_response.json()["submitted_answer"] answers.append({"task_id": task_id, "submitted_answer": submitted_answer}) # Enviar respuestas payload = { "username": USERNAME, "agent_code": SPACE_URL, "answers": answers } submit_response = requests.post(SUBMIT_URL, json=payload) print(submit_response.json())