HCho commited on
Commit
4003c5d
·
verified ·
1 Parent(s): 23e20d8

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +3 -0
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"])