langgraph 0.3.10
Summary of Changes
- Added a new
SchemaCoercionMapperclass to efficiently handle schema coercion with caching (#3806) - Improved how Pydantic models are handled in state updates, respecting field set values (#3839)
- Enhanced
PregelTaskto better handle return values and results (#3839) - Simplified channel writes by removing required channel validation (#3839)
- Added environment variable control for recursion limit via
LANGGRAPH_DEFAULT_RECURSION_LIMIT(#3812, #3813)
Detailed Changes
langgraph.graph.schema_utils.SchemaCoercionMapper
- Added a new utility class for efficiently coercing data to schemas
- Implements caching using weakrefs to improve performance
- Supports both Pydantic v1 and v2 models
- Handles nested structures like lists, dicts, tuples and unions
langgraph.graph.state.StateGraph
- Updated state coercion to use the new
SchemaCoercionMapper - Improved handling of Pydantic models for state updates
- Simplified formatting and structure of conditional code
langgraph.pregel.write.ChannelWrite
- Removed the
require_at_least_one_ofparameter and validation logic - Made channel write operations more permissive, simplifying usage
langgraph.types.PregelTask
- Updated
resultfield to acceptAnytype instead of only dictionaries - This allows for more flexible return values from tasks
langgraph.pregel.debug
- Enhanced
map_debug_task_resultsto includeRETURNvalues in results - Refactored
tasks_w_writesfor better handling of task results - Improved handling of return values in task output
Configuration
- Added support for configuring recursion limit via environment variable
- Set
LANGGRAPH_DEFAULT_RECURSION_LIMITto control recursion depth (default: 25)