Spaces:
Sleeping
Sleeping
stop using add_base_tools=True and set tools explicitly
Browse files
app.py
CHANGED
|
@@ -5,7 +5,13 @@ import litellm
|
|
| 5 |
import requests
|
| 6 |
import inspect
|
| 7 |
import pandas as pd
|
| 8 |
-
from smolagents import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
from api_call_counter import APICallCounter
|
| 10 |
|
| 11 |
# (Keep Constants as is)
|
|
@@ -24,7 +30,14 @@ class BasicAgent:
|
|
| 24 |
model_id="gemini/gemini-2.5-flash",
|
| 25 |
api_key=os.getenv("GOOGLE_API_KEY")
|
| 26 |
)
|
| 27 |
-
self.agent = CodeAgent(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
print("BasicAgent initialized.")
|
| 29 |
def __call__(self, question: str) -> str:
|
| 30 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
|
| 5 |
import requests
|
| 6 |
import inspect
|
| 7 |
import pandas as pd
|
| 8 |
+
from smolagents import (
|
| 9 |
+
CodeAgent,
|
| 10 |
+
LiteLLMModel,
|
| 11 |
+
PythonInterpreterTool,
|
| 12 |
+
DuckDuckGoSearchTool,
|
| 13 |
+
VisitWebpageTool
|
| 14 |
+
)
|
| 15 |
from api_call_counter import APICallCounter
|
| 16 |
|
| 17 |
# (Keep Constants as is)
|
|
|
|
| 30 |
model_id="gemini/gemini-2.5-flash",
|
| 31 |
api_key=os.getenv("GOOGLE_API_KEY")
|
| 32 |
)
|
| 33 |
+
self.agent = CodeAgent(
|
| 34 |
+
tools=[
|
| 35 |
+
PythonInterpreterTool(),
|
| 36 |
+
DuckDuckGoSearchTool(),
|
| 37 |
+
VisitWebpageTool()
|
| 38 |
+
],
|
| 39 |
+
model=model,
|
| 40 |
+
)
|
| 41 |
print("BasicAgent initialized.")
|
| 42 |
def __call__(self, question: str) -> str:
|
| 43 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|