Skip to content

0.2.47

Choose a tag to compare

@github-actions github-actions released this 13 Nov 22:09

langgraph 0.2.47

Summary of Changes

  • Added a new interrupt() function that supports resumable interrupts, allowing for more flexible control flow in graphs
  • Enhanced the Command class with a new resume parameter to resume execution after an interrupt
  • Added support for handling writes that are not associated with a specific task through the NULL_TASK_ID constant
  • Improved task scheduling by supporting pushing tasks during execution
  • Enhanced state update mechanism by separating PUSH writes from channel writes

Detailed Changes

langgraph.types.interrupt

  • Added a new utility function to handle interrupts with resumability
  • Allows nodes to be interrupted and later resumed with specific values
  • Creates interrupts with proper namespace tracking for accurate resumption

langgraph.types.Command

  • Refactored from a regular class with slots to a dataclass for better maintainability
  • Added a new resume parameter to control resumption after an interrupt
  • Enhanced with better string representation methods

langgraph.constants.RESUME

  • Added new constant to identify values used to resume a node after an interrupt

langgraph.constants.NULL_TASK_ID

  • Added new constant to use for writes that are not associated with a task
  • Enables better handling of "global" writes that should be applied independently of task execution

langgraph.graph.state.GraphCommand

  • Updated to a dataclass with improved representation methods
  • Maintains compatibility with the enhanced Command class

langgraph.errors.NodeInterrupt

  • Updated constructor to use keyword arguments for better clarity