Remove customised memory state when using stategraph #31267
Replies: 3 comments 21 replies
-
Hello @SalmonSung! I'm Dosu, your friendly bot here to help you out with bugs, questions, and contributions while we wait for a human maintainer. Let's tackle this together! To address the issue of merging lists when using Here's a potential solution:
Here's how you can modify your function: def format_response(state: SectionState, config: RunnableConfig):
# Transform items using pydantic2dict
code_approval_items_dict = [pydantic2dict(item) for item in state.get("code_approval_items", [])]
# Clear the existing list and extend it with the transformed items
state["code_approval_items"].clear()
state["code_approval_items"].extend(code_approval_items_dict)
return state This approach ensures that you are not merging lists unintentionally. Instead, you clear the existing list and then extend it with the new transformed items. This should help you manage the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
@dosu How can interrupt function in one of the node in the graph to be used, interact with a command line interface tool? I currently write another method which will stream the graph and return the final output. Please suggest me other way with example |
Beta Was this translation helpful? Give feedback.
-
@dosu how does create_react_agent call multiple tools in the same time? I think it is a langgraph style graph and under the hool it is using llm.with_tools(tools) and then send the request to tool_node. If llm.with_tools(tools) can only generate one item in tool_use, how it achieve calling multiple tools in the sametime? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I designed a memory state as following:
I'm trying to manipulate(delete) the values in
code_approval_items
key. However, it always merge two list together...I must use operator.add beacuse this column is collected from a bunch of Send API...Any clue on how to solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions