ama2aifusion commited on
Commit
0755940
·
verified ·
1 Parent(s): 01c19ee

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +2 -1
agent.py CHANGED
@@ -135,6 +135,7 @@ tools = [
135
  web_search_tool,
136
  arvix_search_tool,
137
  ]
 
138
 
139
  # Build graph function
140
  def build_graph(provider: str = "huggingface"):
@@ -167,7 +168,7 @@ def build_graph(provider: str = "huggingface"):
167
  # Node
168
  def assistant(state: MessagesState):
169
  """Assistant node"""
170
- return {"messages": [llm_with_tools.invoke(state["messages"])]}
171
 
172
  # def retriever(state: MessagesState):
173
  # """Retriever node"""
 
135
  web_search_tool,
136
  arvix_search_tool,
137
  ]
138
+ chat_with_tools = chat.bind_tools(tools)
139
 
140
  # Build graph function
141
  def build_graph(provider: str = "huggingface"):
 
168
  # Node
169
  def assistant(state: MessagesState):
170
  """Assistant node"""
171
+ return {"messages": [chat_with_tools.invoke(state["messages"])]}
172
 
173
  # def retriever(state: MessagesState):
174
  # """Retriever node"""