Spaces:
Sleeping
Sleeping
apple muncy
commited on
Commit
·
6b22cf4
1
Parent(s):
b6ac13f
chat_with_tools
Browse filesSigned-off-by: apple muncy <[email protected]>
app.py
CHANGED
@@ -57,7 +57,6 @@ tool_node=ToolNode(tools)
|
|
57 |
class AgentState(TypedDict):
|
58 |
messages: Annotated[list[AnyMessage], add_messages]
|
59 |
|
60 |
-
|
61 |
def assistant(state: AgentState):
|
62 |
# If this is the first message, add the system prompt
|
63 |
if len(state["messages"]) == 1 and isinstance(state["messages"][0], HumanMessage):
|
@@ -76,7 +75,7 @@ builder = StateGraph(AgentState)
|
|
76 |
|
77 |
# Define nodes: these do the work
|
78 |
builder.add_node("assistant", assistant)
|
79 |
-
builder.add_node("tools",
|
80 |
|
81 |
# Define edges: these determine how the control flow moves
|
82 |
builder.add_edge(START, "assistant")
|
|
|
57 |
class AgentState(TypedDict):
|
58 |
messages: Annotated[list[AnyMessage], add_messages]
|
59 |
|
|
|
60 |
def assistant(state: AgentState):
|
61 |
# If this is the first message, add the system prompt
|
62 |
if len(state["messages"]) == 1 and isinstance(state["messages"][0], HumanMessage):
|
|
|
75 |
|
76 |
# Define nodes: these do the work
|
77 |
builder.add_node("assistant", assistant)
|
78 |
+
builder.add_node("tools", chat_with_tools)
|
79 |
|
80 |
# Define edges: these determine how the control flow moves
|
81 |
builder.add_edge(START, "assistant")
|