Spaces:
Sleeping
Sleeping
Sivaraj
commited on
Commit
·
a7e0d98
1
Parent(s):
520e168
Added Search Tool
Browse files
agent.py
CHANGED
@@ -22,8 +22,8 @@ class BaseAgent:
|
|
22 |
self.agent = ToolCallingAgent(
|
23 |
model=openai_model,
|
24 |
tools=[
|
25 |
-
addition_tool,
|
26 |
-
|
27 |
# VisitWebpageTool(),
|
28 |
# FinalAnswerTool(),
|
29 |
],
|
@@ -45,8 +45,8 @@ class BaseAgent:
|
|
45 |
),
|
46 |
)
|
47 |
|
48 |
-
def run(self, question: str) -> str:
|
49 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
50 |
-
response = self.agent.run(question)
|
51 |
print(f"Agent returning response: {response}")
|
52 |
return response.replace("FINAL ANSWER:", "").strip()
|
|
|
22 |
self.agent = ToolCallingAgent(
|
23 |
model=openai_model,
|
24 |
tools=[
|
25 |
+
# addition_tool,
|
26 |
+
DuckDuckGoSearchTool(),
|
27 |
# VisitWebpageTool(),
|
28 |
# FinalAnswerTool(),
|
29 |
],
|
|
|
45 |
),
|
46 |
)
|
47 |
|
48 |
+
def run(self, question: str, additional_args: dict = None) -> str:
|
49 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
50 |
+
response = self.agent.run(question, additional_args=additional_args)
|
51 |
print(f"Agent returning response: {response}")
|
52 |
return response.replace("FINAL ANSWER:", "").strip()
|