pypi langgraph-sdk 0.3.7

latest releases: 0.3.15, 0.3.14, 0.3.13...
3 months ago

langgraph 0.3.7

Summary of Changes

  • Fixed handling of subgraphs with a single node in Graph.add_edge (#3780)
  • Added proper Pydantic model validation for graph inputs, with support for both Pydantic v1 and v2 (#3782)

Detailed Changes

langgraph.graph.graph.Graph

  • Modified add_edge method to allow adding edges to subgraphs with a single node, changing the condition from len(subgraph.nodes) > 1 to len(subgraph.nodes) >= 1 (#3780)

langgraph.graph.state.StateGraph and langgraph.graph.state.CompiledStateGraph

  • Added support for properly validating input against Pydantic models during state graph execution
  • Added specialized handling for both Pydantic v1 and v2 models by using their respective constructor methods (construct vs model_construct)
  • Improved state coercion with the new _pick_mapper function that correctly handles different schema types (#3782)

langgraph.pregel.Pregel

  • Added input_model support to allow for proper Pydantic model validation of inputs
  • Modified get_input_schema to prioritize the input model when available
  • Updated both synchronous and asynchronous execution paths to pass the input model for validation (#3782)

langgraph.pregel.loop.PregelLoop

  • Added validation logic for input data against provided Pydantic models
  • Improved handling of resuming executions by properly setting input status
  • Enhanced input processing to ensure validation happens at the appropriate time (#3782)

Don't miss a new langgraph-sdk release

NewReleases is sending notifications on new releases.