欢迎来到 LangChain 文档,仅供学习参考使用。
Python
StateGraph
class State(TypedDict): some_key: str def bad_node(state: State): # Should return a dict with a value for "some_key", not a list return ["whoops"] builder = StateGraph(State) builder.add_node(bad_node) ... graph = builder.compile()
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