Spaces:
Sleeping
Sleeping
update to use hf model
Browse files
app.py
CHANGED
|
@@ -7,17 +7,14 @@ from tools import ReverseTextTool, RunPythonFileTool, download_server, wiki_tool
|
|
| 7 |
import os
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 10 |
-
from llama_index.core.agent.workflow import
|
| 11 |
-
AgentWorkflow,
|
| 12 |
-
ToolCallResult,
|
| 13 |
-
AgentStream,
|
| 14 |
-
ReActAgent,
|
| 15 |
-
)
|
| 16 |
from llama_index.core.agent.workflow import FunctionAgent
|
| 17 |
from llama_index.core.tools.tool_spec.load_and_search import (
|
| 18 |
LoadAndSearchToolSpec,
|
| 19 |
)
|
| 20 |
from smolagents import DuckDuckGoSearchTool
|
|
|
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
|
|
@@ -60,8 +57,9 @@ class BasicAgent:
|
|
| 60 |
model="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 61 |
api_key=hf_api_key,
|
| 62 |
)
|
| 63 |
-
|
| 64 |
-
|
|
|
|
| 65 |
llm=llm,
|
| 66 |
system_prompt=SYSTEM_PROMPT,
|
| 67 |
)
|
|
|
|
| 7 |
import os
|
| 8 |
from dotenv import load_dotenv
|
| 9 |
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 10 |
+
from llama_index.core.agent.workflow import AgentWorkflow, ToolCallResult, AgentStream
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
from llama_index.core.agent.workflow import FunctionAgent
|
| 12 |
from llama_index.core.tools.tool_spec.load_and_search import (
|
| 13 |
LoadAndSearchToolSpec,
|
| 14 |
)
|
| 15 |
from smolagents import DuckDuckGoSearchTool
|
| 16 |
+
from llama_index.core.agent.workflow import AgentWorkflow
|
| 17 |
+
from llama_index.core.tools import FunctionTool
|
| 18 |
|
| 19 |
|
| 20 |
|
|
|
|
| 57 |
model="Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 58 |
api_key=hf_api_key,
|
| 59 |
)
|
| 60 |
+
|
| 61 |
+
self.agent = AgentWorkflow.from_tools_or_functions(
|
| 62 |
+
tools_or_functions=[ReverseTextTool,RunPythonFileTool,download_server,wiki_tool,YoutubeTranscript, DuckDuckGoSearchTool],
|
| 63 |
llm=llm,
|
| 64 |
system_prompt=SYSTEM_PROMPT,
|
| 65 |
)
|