A LangGraph StateGraph
received a non-dict return type from a node. Here's an example:
classState(TypedDict):some_key:strdefbad_node(state:State):# Should return an dict with a value for "some_key", not a listreturn["whoops"]builder=StateGraph(State)builder.add_node(bad_node)...graph=builder.compile()
Invoking the above graph will result in an error like this:
graph.invoke({"some_key":"someval"});
InvalidUpdateError: Expected dict, got ['whoops']
For troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/INVALID_GRAPH_NODE_RETURN_VALUE
Nodes in your graph must return an dict containing one or more keys defined in your state.