Spaces:
Sleeping
Sleeping
Update web_agent.py
Browse files- web_agent.py +3 -1
web_agent.py
CHANGED
|
@@ -7,6 +7,7 @@ from llama_index.core.tools import QueryEngineTool
|
|
| 7 |
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
| 8 |
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 9 |
from llama_index.core.agent.workflow import ReActAgent
|
|
|
|
| 10 |
|
| 11 |
def initialize_web_agent(llm: HuggingFaceInferenceAPI):
|
| 12 |
hf_token = os.environ.get('HF_TOKEN')
|
|
@@ -28,11 +29,12 @@ def initialize_web_agent(llm: HuggingFaceInferenceAPI):
|
|
| 28 |
description="Query engine for the agent",
|
| 29 |
return_direct=False
|
| 30 |
)
|
|
|
|
| 31 |
|
| 32 |
return ReActAgent(
|
| 33 |
name="query_engine",
|
| 34 |
description="Query engine for the agent",
|
| 35 |
-
tools=[query_engine_tool],
|
| 36 |
system_prompt="You are a calculator assistant. Use your tools for any math operation.",
|
| 37 |
llm=llm
|
| 38 |
)
|
|
|
|
| 7 |
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
| 8 |
from llama_index.llms.huggingface_api import HuggingFaceInferenceAPI
|
| 9 |
from llama_index.core.agent.workflow import ReActAgent
|
| 10 |
+
from search_agent import init_search_tool
|
| 11 |
|
| 12 |
def initialize_web_agent(llm: HuggingFaceInferenceAPI):
|
| 13 |
hf_token = os.environ.get('HF_TOKEN')
|
|
|
|
| 29 |
description="Query engine for the agent",
|
| 30 |
return_direct=False
|
| 31 |
)
|
| 32 |
+
search_tool = init_search_tool()
|
| 33 |
|
| 34 |
return ReActAgent(
|
| 35 |
name="query_engine",
|
| 36 |
description="Query engine for the agent",
|
| 37 |
+
tools=[query_engine_tool, search_tool],
|
| 38 |
system_prompt="You are a calculator assistant. Use your tools for any math operation.",
|
| 39 |
llm=llm
|
| 40 |
)
|