Spaces:
Sleeping
Sleeping
Commit ·
957778e
1
Parent(s): d73cb28
add user agent
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
|
| 7 |
from smolagents import OpenAIServerModel, ToolCallingAgent, DuckDuckGoSearchTool
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
@@ -60,7 +60,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 60 |
# 2. Fetch Questions
|
| 61 |
print(f"Fetching questions from: {questions_url}")
|
| 62 |
try:
|
| 63 |
-
response = requests.get(questions_url, timeout=15)
|
| 64 |
response.raise_for_status()
|
| 65 |
questions_data = response.json()
|
| 66 |
if not questions_data:
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
import uuid
|
| 7 |
from smolagents import OpenAIServerModel, ToolCallingAgent, DuckDuckGoSearchTool
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
|
|
| 60 |
# 2. Fetch Questions
|
| 61 |
print(f"Fetching questions from: {questions_url}")
|
| 62 |
try:
|
| 63 |
+
response = requests.get(questions_url, timeout=15, headers = {'User-agent': f'your bot {str(uuid.uuid4())}'})
|
| 64 |
response.raise_for_status()
|
| 65 |
questions_data = response.json()
|
| 66 |
if not questions_data:
|