pypi langgraph-sdk 0.2.5

latest releases: 0.3.14, 0.3.13, 0.3.12...
8 months ago

langgraph 0.2.5

Summary of Changes

  • Added support for preserving task errors in state snapshots, allowing better visibility into failures
  • Enhanced state history tracking with proper step numbering and task details
  • Simplified the managed values interface by removing the unnecessary task parameter
  • Improved error handling during graph execution with better mechanisms to save errors to checkpoints
  • Added new error constant for more consistent error tracking across the system

Detailed Changes

langgraph.constants.ERROR

  • Added new constant ERROR = "__error__" for tracking and propagating errors in graph execution
  • Added the ERROR constant to the RESERVED set of special keys

langgraph.managed.base.ManagedValue

  • Simplified interface by removing the task parameter from the __call__ method
  • Changed signature from __call__(self, step: int, task: PregelTaskDescription) -> V to __call__(self, step: int) -> V

langgraph.managed.is_last_step.IsLastStepManager

  • Updated to match the simplified ManagedValue interface by removing the task parameter
  • Changed signature from __call__(self, step: int, task: PregelExecutableTask) to __call__(self, step: int)

langgraph.pregel.types.StateSnapshot

  • Enhanced with additional field tasks to include information about tasks with errors
  • Added better typing and documentation for fields
  • Improved representation of task state in snapshots

langgraph.pregel.types.PregelTask

  • Replaced PregelTaskDescription with enhanced PregelTask class
  • Added id field to uniquely identify tasks
  • Added optional error field to track exceptions that occurred during task execution

langgraph.pregel.algo

  • Improved task preparation logic in prepare_next_tasks function
  • Made task ID generation more consistent for both execution and non-execution contexts
  • Updated managed value handling to use simplified interface without task parameter

langgraph.pregel.debug

  • Added tasks_w_writes function to associate tasks with their writes and any errors
  • Enhanced checkpoint debug output to include task errors
  • Improved visibility of task execution state in debug information

langgraph.pregel.init.Pregel

  • Enhanced get_state and aget_state methods to include proper step numbers and task information
  • Added tracking of task errors in state snapshots
  • Added _exception and _should_stop_others helper functions for better error handling
  • Changed error handling in task execution to save errors to the checkpointer
  • Fixed debug output to use the passed parameter instead of instance variable

langgraph.pregel.loop.PregelLoop

  • Updated to skip ERROR entries when processing pending writes
  • Improved handling of error cases in the task execution flow

Don't miss a new langgraph-sdk release

NewReleases is sending notifications on new releases.