[PR #5032] feat: add response_schema to interrupt and Interrupt #4195

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

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

State: closed
Merged: No


close #5027

Summary

Adds optional response_schema parameter to interrupt() function and Interrupt dataclass to enable structured validation of resume values in human-in-the-loop workflows.

Changes

  • Core functionality: Added response_schema: dict | None field to Interrupt dataclass
  • API enhancement: Modified interrupt(value, *, response_schema=None) to accept Pydantic model classes
  • Validation: Resume values are validated against the schema and converted to model instances
  • Error handling: Invalid data triggers new interrupts with detailed validation error messages

Technical Details

  • Stores JSON schema dictionaries (not Pydantic classes) for proper serialization
  • Compatible with all checkpointers and graph state persistence
  • Maintains backward compatibility - existing code works unchanged
  • Validation errors include detailed field-level feedback
**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/5032 **State:** closed **Merged:** No --- close #5027 ### Summary Adds optional `response_schema` parameter to `interrupt()` function and `Interrupt` dataclass to enable structured validation of resume values in human-in-the-loop workflows. ### Changes - **Core functionality**: Added `response_schema: dict | None` field to `Interrupt` dataclass - **API enhancement**: Modified `interrupt(value, *, response_schema=None)` to accept Pydantic model classes - **Validation**: Resume values are validated against the schema and converted to model instances - **Error handling**: Invalid data triggers new interrupts with detailed validation error messages ### Technical Details - Stores JSON schema dictionaries (not Pydantic classes) for proper serialization - Compatible with all checkpointers and graph state persistence - Maintains backward compatibility - existing code works unchanged - Validation errors include detailed field-level feedback
yindo added the pull-request label 2026-02-20 17:49:49 -05:00
yindo closed this issue 2026-02-20 17:49:49 -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#4195