Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -113,6 +113,9 @@ def build_graph(provider: str = "huggingface"):
|
|
| 113 |
huggingfacehub_api_token=hf_api_key,
|
| 114 |
model_kwargs={"temperature": 0}
|
| 115 |
)
|
|
|
|
|
|
|
|
|
|
| 116 |
def assistant(state: MessagesState):
|
| 117 |
""" Use the tools to answer the query. you have add,subtract,multiply,divide,web_search,wikipedia_search,arxiv_search tools."""
|
| 118 |
response = llm_with_tools.invoke([system_message]+state["messages"])
|
|
|
|
| 113 |
huggingfacehub_api_token=hf_api_key,
|
| 114 |
model_kwargs={"temperature": 0}
|
| 115 |
)
|
| 116 |
+
# Bind tools to LLM
|
| 117 |
+
llm_with_tools = llm.bind_tools(tools)
|
| 118 |
+
|
| 119 |
def assistant(state: MessagesState):
|
| 120 |
""" Use the tools to answer the query. you have add,subtract,multiply,divide,web_search,wikipedia_search,arxiv_search tools."""
|
| 121 |
response = llm_with_tools.invoke([system_message]+state["messages"])
|