File size: 2,390 Bytes
4d7d7f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
You can access the GAIA benchmark API provided for your agent's evaluation using the following endpoints, as described in the provided documentation:

### Base URL
The API's base URL (according to the provided document) is:
```
https://agents-course-unit4-scoring.hf.space
```

### API Endpoints

1. **Retrieve Evaluation Questions**  
   Endpoint:
   ```
   GET /questions
   ```
   - Returns the full list of filtered evaluation questions.

2. **Retrieve a Random Question**  
   Endpoint:
   ```
   GET /random-question
   ```
   - Fetches a single random question from the available set.

3. **Download Associated Files**  
   Endpoint:
   ```
   GET /files/{task_id}
   ```
   - Downloads files associated with specific tasks, useful for questions that require external data or multimodal analysis.

4. **Submit Agent Answers**  
   Endpoint:
   ```
   POST /submit
   ```
   - Submit your agent's answers to be evaluated against the benchmark.
   - Requires JSON payload structured as:
   ```json
   {
     "username": "Your Hugging Face username",
     "agent_code": "URL to your Hugging Face Space code repository",
     "answers": [{"task_id": "task identifier", "submitted_answer": "your answer"}]
   }
   ```

### API Usage Example:
Here's an illustrative example using Python and the `requests` library:

```python
import requests

BASE_URL = "https://agents-course-unit4-scoring.hf.space"

# Retrieve all questions
response = requests.get(f"{BASE_URL}/questions")
questions = response.json()

# Fetch a random question
random_question = requests.get(f"{BASE_URL}/random-question").json()

# Download a file for a specific task_id
task_id = "example_task_id"
file_response = requests.get(f"{BASE_URL}/files/{task_id}")
with open("downloaded_file", "wb") as f:
    f.write(file_response.content)

# Submit answers
submission_payload = {
    "username": "your_username",
    "agent_code": "https://huggingface.co/spaces/your_username/your_space_name/tree/main",
    "answers": [{"task_id": "task_id", "submitted_answer": "answer_text"}]
}
submit_response = requests.post(f"{BASE_URL}/submit", json=submission_payload)
print(submit_response.json())
```

Ensure you have proper authentication if required, and replace placeholder texts (`your_username`, `task_id`, `answer_text`, etc.) with your actual values. 

Let me know if you need further assistance or more detailed examples!