Spaces:
Sleeping
Sleeping
Update BasicAgent.py
Browse files- BasicAgent.py +3 -2
BasicAgent.py
CHANGED
|
@@ -8,7 +8,7 @@ from smolagents import (
|
|
| 8 |
FinalAnswerTool,
|
| 9 |
DuckDuckGoSearchTool,
|
| 10 |
GoogleSearchTool,
|
| 11 |
-
|
| 12 |
|
| 13 |
)
|
| 14 |
|
|
@@ -35,9 +35,10 @@ class newAgent:
|
|
| 35 |
# add_base_tools=True already gives you search, python, etc.
|
| 36 |
self.agent = CodeAgent(tools=[], model=model, add_base_tools=True)
|
| 37 |
|
| 38 |
-
|
| 39 |
"""ONE question in → ONE pure-text answer out."""
|
| 40 |
#↓ Replace .run with whatever method actually returns the answer string.
|
|
|
|
| 41 |
return answer
|
| 42 |
|
| 43 |
#answer = self.run
|
|
|
|
| 8 |
FinalAnswerTool,
|
| 9 |
DuckDuckGoSearchTool,
|
| 10 |
GoogleSearchTool,
|
| 11 |
+
VistWebPageTool
|
| 12 |
|
| 13 |
)
|
| 14 |
|
|
|
|
| 35 |
# add_base_tools=True already gives you search, python, etc.
|
| 36 |
self.agent = CodeAgent(tools=[], model=model, add_base_tools=True)
|
| 37 |
|
| 38 |
+
def __call__(self, question: str) -> str:
|
| 39 |
"""ONE question in → ONE pure-text answer out."""
|
| 40 |
#↓ Replace .run with whatever method actually returns the answer string.
|
| 41 |
+
result = self.agent.run(question)
|
| 42 |
return answer
|
| 43 |
|
| 44 |
#answer = self.run
|