M.Natale commited on
Commit ·
7667ae1
1
Parent(s): d0ba1a4
increase max_steps number and added FinalAnswerTool
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
from tools import youtube_tool
|
| 6 |
-
from smolagents import DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, InferenceClientModel, GoogleSearchTool
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
| 9 |
# --- Constants ---
|
|
@@ -13,7 +13,8 @@ serpapi_key = os.environ.get("SERPAPI_KEY")
|
|
| 13 |
tool = [
|
| 14 |
GoogleSearchTool(provider="serpapi"),
|
| 15 |
WikipediaSearchTool(),
|
| 16 |
-
youtube_tool
|
|
|
|
| 17 |
]
|
| 18 |
# --- Basic Agent Definition ---
|
| 19 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
|
@@ -22,8 +23,7 @@ class BasicAgent:
|
|
| 22 |
self.agent = CodeAgent(
|
| 23 |
model= InferenceClientModel(model_id="openai/gpt-oss-20b", max_tokens=2048, provider="together"),
|
| 24 |
tools=tool,
|
| 25 |
-
|
| 26 |
-
max_steps=2,
|
| 27 |
add_base_tools=True,
|
| 28 |
)
|
| 29 |
print("BasicAgent initialized.")
|
|
|
|
| 3 |
import requests
|
| 4 |
import pandas as pd
|
| 5 |
from tools import youtube_tool
|
| 6 |
+
from smolagents import DuckDuckGoSearchTool, CodeAgent, WikipediaSearchTool, InferenceClientModel, GoogleSearchTool, FinalAnswerTool
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
| 9 |
# --- Constants ---
|
|
|
|
| 13 |
tool = [
|
| 14 |
GoogleSearchTool(provider="serpapi"),
|
| 15 |
WikipediaSearchTool(),
|
| 16 |
+
youtube_tool,
|
| 17 |
+
FinalAnswerTool()
|
| 18 |
]
|
| 19 |
# --- Basic Agent Definition ---
|
| 20 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
|
|
|
| 23 |
self.agent = CodeAgent(
|
| 24 |
model= InferenceClientModel(model_id="openai/gpt-oss-20b", max_tokens=2048, provider="together"),
|
| 25 |
tools=tool,
|
| 26 |
+
max_steps=5,
|
|
|
|
| 27 |
add_base_tools=True,
|
| 28 |
)
|
| 29 |
print("BasicAgent initialized.")
|