github langchain-ai/langgraph 0.4.0

latest releases: cli==0.4.10, 1.0.5, sdk==0.3.0...
7 months ago

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_id property 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 interrupts field 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 resume parameter to support mapping interrupt IDs to resume values #4406
  • Improved documentation for the resume parameter #4406

langgraph.pregel.Pregel

  • Improved invoke and ainvoke methods 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

langgraph.pregel.draw

  • Improved graph visualization to correctly handle END nodes #4409
  • Added add_edge utility function to prevent duplicate edges in graph visualization #4409

Don't miss a new langgraph release

NewReleases is sending notifications on new releases.