langgraph 0.3.8
Summary of Changes
- Enhanced handling of Pydantic models in StateGraph nodes by only sending state updates for fields that differ from their default values, rather than fields that were explicitly set by users #3783
Detailed Changes
langgraph.graph.state.StateGraph
- Improved how Pydantic model fields are handled when returned from node functions #3783
- Changed from only updating values for keys explicitly set by users to only updating values that differ from default values
- This provides more intuitive behavior when working with Pydantic models that have default values
- Handles both Pydantic v1 and v2 correctly by examining model fields and their defaults