langgraph 0.2.12
Summary of Changes
- Improved error messages for channel operations, now including the channel key in error messages for easier debugging #1437
- Fixed automatic type detection for node functions, improving schema detection reliability #1332
- Simplified internal interrupt handling for more consistent behavior #1436
- Fixed async task handling in AsyncBackgroundExecutor for better exception management #1442
- Removed unused method from PregelLoop #1440
Detailed Changes
langgraph.channels.base.BaseChannel
- Added
keyproperty to track which channel key a channel instance is associated with #1437 - Added
from_checkpoint_namedandafrom_checkpoint_namedmethods to preserve channel keys when restoring from checkpoints #1437 - Updated type annotations from
GeneratortoIteratorandAsyncGeneratortoAsyncIteratorfor better type clarity #1437
langgraph.channels.* (Multiple Channel Implementations)
- Enhanced error messages in all channel implementations to include the channel key in error messages #1437
- Improved guidance in error messages for LastValue, EphemeralValue, and UntrackedValue to suggest alternatives (e.g., using Annotated keys or guard=False) #1437
langgraph.graph.state.StateGraph
- Fixed automatic input type detection logic to correctly identify function parameter types, using
inspect.signaturefor more reliable parameter name detection #1332 - Added handling for additional exceptions (StopIteration) when introspecting function parameters #1332
- Removed redundant
support_multiple_edgessetting logic #1437 - Updated channel creation logic to set the channel key, improving error messages #1437
langgraph.graph.graph.Graph
- Improved validation error message in
add_edgemethod to clarify when to use StateGraph with Annotated state keys #1437
langgraph.constants.Interrupt and langgraph.errors.GraphInterrupt
- Simplified the
Interruptdata class to focus on value rather than "when" it occurred #1436 - Simplified
GraphInterruptto accept an optional empty sequence of interrupts #1436
langgraph.pregel.executor.AsyncBackgroundExecutor
- Fixed async task handling to properly manage exceptions and task completion #1442
- Improved how GraphInterrupt exceptions are handled, distinguishing them from other exceptions #1442