langgraph 0.4.0
Summary of Changes
- Added improved support for interrupt handling in streaming modes, with interrupts now properly propagated in
"values"stream mode #4374 - Enhanced interrupt resumption with namespace-specific resume values, allowing targeted resumption of specific interrupts #4406
- Fixed branch handling to properly process END nodes in graph visualization and execution #4409
- Fixed issue where empty Commands with resume maps would raise an error #4444
- Updated Python compatibility to allow future Python versions while maintaining 3.9+ support #4416
Detailed Changes
langgraph.types.Interrupt
- Added
interrupt_idproperty that generates a unique ID for the interrupt based on its namespace #4406 - Updated ID generation to use
|as a separator between namespace elements for better uniqueness #4406
langgraph.types.StreamMode
- Updated docstring to clarify that
"values"mode emits all values including interrupts after each step #4374
langgraph.types.StateSnapshot
- Added
interruptsfield to track interrupts that occurred in a step and are pending resolution #4406 - Improved documentation for all fields in the class #4406
langgraph.types.Command
- Enhanced
resumeparameter to support mapping interrupt IDs to resume values #4406 - Improved documentation for the
resumeparameter #4406
langgraph.pregel.Pregel
- Improved
invokeandainvokemethods to properly collect and handle interrupts in streamed output #4374 - Enhanced interrupt emission to work in both
"values"and"updates"stream modes #4374 - Modified state snapshot preparation to collect interrupts from tasks #4406
langgraph.graph.branch.Writer
- Updated signature to accept a boolean parameter indicating whether the operation is for static writes #4409
- Fixed branch handling to properly process END nodes #4409
langgraph.pregel.loop.PregelLoop
- Fixed Command handling to support empty Commands with resume maps #4444
- Added support for namespace-based resumption through CONFIG_KEY_RESUME_MAP #4406