MariaFilipkowska commited on
Commit
f439067
·
verified ·
1 Parent(s): c50a91d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -148,20 +148,19 @@ class AgentState(TypedDict):
148
  messages: Annotated[list[AnyMessage], add_messages]
149
 
150
 
151
-
152
-
153
- def build_agent(chat):
154
- def assistant(state: AgentState):
155
- return {
156
  "messages": chat.invoke(state["messages"]),
157
- }
 
 
158
  tools = [get_file_path_tool, get_content_tool, search_web_tool, extract_text_tool, play_chess_tool, run_code_tool]
159
  chat_with_tools = chat.bind_tools(tools, parallel_tool_calls=False)
160
  # The graph
161
  builder = StateGraph(AgentState)
162
 
163
  # Define nodes: these do the work
164
- builder.add_node("assistant", assistant)
165
  builder.add_node("tools", ToolNode([get_file_path_tool]))
166
 
167
  # Define edges: these determine how the control flow moves
 
148
  messages: Annotated[list[AnyMessage], add_messages]
149
 
150
 
151
+ def assistant(state: AgentState, chat):
152
+ return {
 
 
 
153
  "messages": chat.invoke(state["messages"]),
154
+ }
155
+
156
+ def build_agent(chat):
157
  tools = [get_file_path_tool, get_content_tool, search_web_tool, extract_text_tool, play_chess_tool, run_code_tool]
158
  chat_with_tools = chat.bind_tools(tools, parallel_tool_calls=False)
159
  # The graph
160
  builder = StateGraph(AgentState)
161
 
162
  # Define nodes: these do the work
163
+ builder.add_node("assistant", assistant(chat))
164
  builder.add_node("tools", ToolNode([get_file_path_tool]))
165
 
166
  # Define edges: these determine how the control flow moves