Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -48,7 +48,7 @@ class BasicAgent:
|
|
| 48 |
return self.run(question)
|
| 49 |
#return self.agent.run(question)
|
| 50 |
|
| 51 |
-
def create_llamaindex_agent() ->
|
| 52 |
api_key = os.getenv("HF_TOKEN")
|
| 53 |
llm = HuggingFaceInferenceAPI(
|
| 54 |
model_name="deepseek-ai/DeepSeek-R1-0528",
|
|
@@ -56,21 +56,11 @@ def create_llamaindex_agent() -> ReActAgent:
|
|
| 56 |
provider="auto",
|
| 57 |
max_iterations=10
|
| 58 |
)
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
round_to_two_decimals_tool,
|
| 65 |
-
text_inverter_tool,
|
| 66 |
-
google_web_search_tool
|
| 67 |
-
]
|
| 68 |
-
|
| 69 |
-
agent = ReActAgent.from_tools(
|
| 70 |
-
tools=tools,
|
| 71 |
-
llm=self.llm,
|
| 72 |
-
verbose=True
|
| 73 |
-
)
|
| 74 |
|
| 75 |
return agent
|
| 76 |
|
|
|
|
| 48 |
return self.run(question)
|
| 49 |
#return self.agent.run(question)
|
| 50 |
|
| 51 |
+
def create_llamaindex_agent() -> AgentWorkflow:
|
| 52 |
api_key = os.getenv("HF_TOKEN")
|
| 53 |
llm = HuggingFaceInferenceAPI(
|
| 54 |
model_name="deepseek-ai/DeepSeek-R1-0528",
|
|
|
|
| 56 |
provider="auto",
|
| 57 |
max_iterations=10
|
| 58 |
)
|
| 59 |
+
agent = AgentWorkflow.from_tools_or_functions(
|
| 60 |
+
[wikipedia_search_tool, youtube_transcript_tool, youtube_transcript_snippet_tool,
|
| 61 |
+
round_to_two_decimals_tool, text_inverter_tool, google_web_search_tool],
|
| 62 |
+
llm=llm
|
| 63 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
return agent
|
| 66 |
|