Spaces:
Runtime error
Runtime error
Change CodeAgent to ToolCallingAgent
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
from smolagents import CodeAgent, OpenAIServerModel, DuckDuckGoSearchTool, VisitWebpageTool, tool, \
|
| 6 |
-
FinalAnswerTool, PythonInterpreterTool, SpeechToTextTool
|
| 7 |
import yaml
|
| 8 |
import importlib
|
| 9 |
from io import BytesIO
|
|
@@ -86,7 +86,7 @@ class BasicAgent:
|
|
| 86 |
def __init__(self):
|
| 87 |
model = OpenAIServerModel(api_key=os.environ.get("OPENAI_API_KEY"), model_id="gpt-4o")
|
| 88 |
|
| 89 |
-
self.code_agent =
|
| 90 |
tools=[PythonInterpreterTool(), DuckDuckGoSearchTool(), VisitWebpageTool(), SpeechToTextTool(),
|
| 91 |
get_youtube_transcript,
|
| 92 |
FinalAnswerTool()],
|
|
|
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
from smolagents import CodeAgent, OpenAIServerModel, DuckDuckGoSearchTool, VisitWebpageTool, tool, \
|
| 6 |
+
FinalAnswerTool, PythonInterpreterTool, SpeechToTextTool, ToolCallingAgent
|
| 7 |
import yaml
|
| 8 |
import importlib
|
| 9 |
from io import BytesIO
|
|
|
|
| 86 |
def __init__(self):
|
| 87 |
model = OpenAIServerModel(api_key=os.environ.get("OPENAI_API_KEY"), model_id="gpt-4o")
|
| 88 |
|
| 89 |
+
self.code_agent = ToolCallingAgent(
|
| 90 |
tools=[PythonInterpreterTool(), DuckDuckGoSearchTool(), VisitWebpageTool(), SpeechToTextTool(),
|
| 91 |
get_youtube_transcript,
|
| 92 |
FinalAnswerTool()],
|