Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,27 +30,27 @@ class BasicAgent:
|
|
| 30 |
provider="auto",
|
| 31 |
max_iterations=10
|
| 32 |
)
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
# )
|
| 38 |
-
|
| 39 |
-
self.tools = [
|
| 40 |
-
wikipedia_search_tool,
|
| 41 |
-
youtube_transcript_tool,
|
| 42 |
-
youtube_transcript_snippet_tool,
|
| 43 |
-
round_to_two_decimals_tool,
|
| 44 |
-
text_inverter_tool,
|
| 45 |
-
google_web_search_tool
|
| 46 |
-
]
|
| 47 |
-
|
| 48 |
-
self.agent = ReActAgent.from_tools(
|
| 49 |
-
tools=self.tools,
|
| 50 |
-
llm=self.llm,
|
| 51 |
-
verbose=True
|
| 52 |
)
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
async def run(self, question: str) -> str:
|
| 55 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 56 |
answer = await self.agent.run(question)
|
|
|
|
| 30 |
provider="auto",
|
| 31 |
max_iterations=10
|
| 32 |
)
|
| 33 |
+
self.agent = AgentWorkflow.from_tools_or_functions(
|
| 34 |
+
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool,
|
| 35 |
+
round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 36 |
+
llm=self.llm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
)
|
| 38 |
|
| 39 |
+
# self.tools = [
|
| 40 |
+
# wikipedia_search_tool,
|
| 41 |
+
# youtube_transcript_tool,
|
| 42 |
+
# youtube_transcript_snippet_tool,
|
| 43 |
+
# round_to_two_decimals_tool,
|
| 44 |
+
# text_inverter_tool,
|
| 45 |
+
# google_web_search_tool
|
| 46 |
+
# ]
|
| 47 |
+
|
| 48 |
+
# self.agent = ReActAgent.from_tools(
|
| 49 |
+
# tools=self.tools,
|
| 50 |
+
# llm=self.llm,
|
| 51 |
+
# verbose=True
|
| 52 |
+
# )
|
| 53 |
+
|
| 54 |
async def run(self, question: str) -> str:
|
| 55 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
| 56 |
answer = await self.agent.run(question)
|