Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ import pandas as pd
|
|
6 |
from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool
|
7 |
from tools import TextTransformerTool
|
8 |
from smolagents import InferenceClientModel
|
|
|
9 |
|
10 |
# (Keep Constants as is)
|
11 |
# --- Constants ---
|
@@ -33,12 +34,14 @@ class BasicAgent:
|
|
33 |
model = InferenceClientModel(provider="openai", token=openai_token, model_id="gpt-3.5-turbo")
|
34 |
search_tool = DuckDuckGoSearchTool()
|
35 |
text_tool = TextTransformerTool()
|
36 |
-
|
37 |
self.agent = CodeAgent(
|
38 |
model=model,
|
39 |
-
tools=[search_tool, text_tool],
|
40 |
add_base_tools=True,
|
41 |
-
planning_interval=2
|
|
|
|
|
42 |
)
|
43 |
|
44 |
def __call__(self, question: str) -> str:
|
|
|
6 |
from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool
|
7 |
from tools import TextTransformerTool
|
8 |
from smolagents import InferenceClientModel
|
9 |
+
from tools.final_answer import FinalAnswerTool
|
10 |
|
11 |
# (Keep Constants as is)
|
12 |
# --- Constants ---
|
|
|
34 |
model = InferenceClientModel(provider="openai", token=openai_token, model_id="gpt-3.5-turbo")
|
35 |
search_tool = DuckDuckGoSearchTool()
|
36 |
text_tool = TextTransformerTool()
|
37 |
+
final_answer = FinalAnswerTool()
|
38 |
self.agent = CodeAgent(
|
39 |
model=model,
|
40 |
+
tools=[search_tool, text_tool, final_answer],
|
41 |
add_base_tools=True,
|
42 |
+
planning_interval=2,
|
43 |
+
max_steps=6,
|
44 |
+
verbosity_level=1,
|
45 |
)
|
46 |
|
47 |
def __call__(self, question: str) -> str:
|