Skip to main content
LangGraph StateGraph가 노드로부터 dict가 아닌 반환 타입을 받았습니다. 다음은 예시입니다:
class State(TypedDict):
    some_key: str

def bad_node(state: State):
    # "some_key"에 대한 값을 포함하는 dict를 반환해야 하는데, 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
그래프의 노드는 상태에 정의된 하나 이상의 키를 포함하는 dict를 반환해야 합니다.

문제 해결

다음 사항이 이 오류를 해결하는 데 도움이 될 수 있습니다:
  • 노드에 복잡한 로직이 있는 경우, 모든 코드 경로가 정의된 상태에 적합한 dict를 반환하는지 확인하세요.

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I