Spaces:
Sleeping
Sleeping
Update api.py
Browse files
api.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
| 1 |
import requests
|
| 2 |
|
| 3 |
-
API_BASE = "https://gaia-
|
| 4 |
|
| 5 |
def get_all_questions():
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def get_random_question():
|
| 9 |
return requests.get(f"{API_BASE}/random-question").json()
|
|
|
|
| 1 |
import requests
|
| 2 |
|
| 3 |
+
API_BASE = "https://gaia-agent-api.spacelab.dev" # Use your actual base here
|
| 4 |
|
| 5 |
def get_all_questions():
|
| 6 |
+
print(f"[INFO] Fetching: {API_BASE}/questions")
|
| 7 |
+
response = requests.get(f"{API_BASE}/questions")
|
| 8 |
+
|
| 9 |
+
print("[DEBUG] Status Code:", response.status_code)
|
| 10 |
+
print("[DEBUG] Raw Response:", response.text[:500]) # limit to 500 chars
|
| 11 |
+
|
| 12 |
+
response.raise_for_status() # raise if 4xx/5xx
|
| 13 |
+
|
| 14 |
+
return response.json()
|
| 15 |
|
| 16 |
def get_random_question():
|
| 17 |
return requests.get(f"{API_BASE}/random-question").json()
|