Spaces:
Paused
Paused
rcwaterman
commited on
Commit
•
33319c8
1
Parent(s):
890d151
Fixing bug in memory
Browse files
app.py
CHANGED
@@ -201,7 +201,7 @@ class AgentState(TypedDict):
|
|
201 |
messages: Annotated[list, add_messages]
|
202 |
|
203 |
#-----CREATE NODES-----#
|
204 |
-
async def call_model(state, config: RunnableConfig):
|
205 |
messages = state["messages"]
|
206 |
response = await model.ainvoke(messages, config)
|
207 |
return {"messages" : [response]}
|
@@ -217,7 +217,6 @@ def call_tool(state):
|
|
217 |
)
|
218 |
|
219 |
response = tool_executor.invoke(action)
|
220 |
-
|
221 |
function_message = FunctionMessage(content=str(response), name=action.tool)
|
222 |
|
223 |
return {"messages" : [function_message]}
|
@@ -246,7 +245,9 @@ workflow.add_conditional_edges(
|
|
246 |
)
|
247 |
|
248 |
workflow.add_edge("use tool", "agent")
|
249 |
-
app = workflow.compile(checkpointer=memory
|
|
|
|
|
250 |
|
251 |
#-----CONFIGURE CHAINLIT APP-----#
|
252 |
|
|
|
201 |
messages: Annotated[list, add_messages]
|
202 |
|
203 |
#-----CREATE NODES-----#
|
204 |
+
async def call_model(state:AgentState, config: RunnableConfig):
|
205 |
messages = state["messages"]
|
206 |
response = await model.ainvoke(messages, config)
|
207 |
return {"messages" : [response]}
|
|
|
217 |
)
|
218 |
|
219 |
response = tool_executor.invoke(action)
|
|
|
220 |
function_message = FunctionMessage(content=str(response), name=action.tool)
|
221 |
|
222 |
return {"messages" : [function_message]}
|
|
|
245 |
)
|
246 |
|
247 |
workflow.add_edge("use tool", "agent")
|
248 |
+
app = workflow.compile() #can add checkpointer=memory argument here, need to figure out this error with it:
|
249 |
+
#ValueError: Checkpointer requires one or more of the following 'configurable' keys: ['thread_id', 'thread_ts']
|
250 |
+
#Has something to do with runnableconfig, may need a different kind of runnableconfig.
|
251 |
|
252 |
#-----CONFIGURE CHAINLIT APP-----#
|
253 |
|