Update app.py
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 |
-
from smolagents import CodeAgent,
|
| 7 |
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
@@ -111,7 +111,11 @@ class BasicAgent:
|
|
| 111 |
read_spreadsheet,
|
| 112 |
get_youtube_transcript,
|
| 113 |
],
|
| 114 |
-
model=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
#additional_authorized_imports=["pandas", "requests", "re"],
|
| 116 |
#instructions = "If the question includes a task_id and mentions a file, call fetch_task_file first; route YouTube URLs to get_youtube_transcript, other URLs to visit_webpage, PDFs to pdf_tool, and spreadsheets to read_spreadsheet, using web_search only when no URL or file is given,then respond with only the exact final answer value, no explanation, no prefix.",
|
| 117 |
max_steps=20,
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, OpenAIServerModel, DuckDuckGoSearchTool,Tool,tool,PythonInterpreterTool,VisitWebpageTool,FinalAnswerTool
|
| 7 |
|
| 8 |
|
| 9 |
# (Keep Constants as is)
|
|
|
|
| 111 |
read_spreadsheet,
|
| 112 |
get_youtube_transcript,
|
| 113 |
],
|
| 114 |
+
model= OpenAIServerModel(
|
| 115 |
+
model_id="openai/gpt-oss-20b:free",
|
| 116 |
+
api_base="https://openrouter.ai/api/v1",
|
| 117 |
+
api_key=os.environ["OPENROUTER_API_KEY"],
|
| 118 |
+
) ,
|
| 119 |
#additional_authorized_imports=["pandas", "requests", "re"],
|
| 120 |
#instructions = "If the question includes a task_id and mentions a file, call fetch_task_file first; route YouTube URLs to get_youtube_transcript, other URLs to visit_webpage, PDFs to pdf_tool, and spreadsheets to read_spreadsheet, using web_search only when no URL or file is given,then respond with only the exact final answer value, no explanation, no prefix.",
|
| 121 |
max_steps=20,
|