[PR #6630] Fix Pydantic output_schema coercion for Graph invoke #5176

Closed
opened 2026-02-20 17:51:20 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6630

State: closed
Merged: No


Description:
Fixes #6607. I added a post-invoke/ainvoke coercion step so graphs with a Pydantic output_schema return actual model instances instead of raw dicts, and I added a regression test (test_state_graph_returns_output_model_instance) to prove the behavior.

Issue: #6607

Dependencies: None

Twitter handle: ai_osas

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6630 **State:** closed **Merged:** No --- **Description:** Fixes #6607. I added a post-invoke/ainvoke coercion step so graphs with a Pydantic `output_schema` return actual model instances instead of raw dicts, and I added a regression test (`test_state_graph_returns_output_model_instance`) to prove the behavior. **Issue:** #6607 **Dependencies:** None **Twitter handle:** ai_osas
yindo added the pull-request label 2026-02-20 17:51:20 -05:00
yindo closed this issue 2026-02-20 17:51:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5176