langgraph 0.4.1
Summary of Changes
- Fixed an issue handling
END
in StateGraph edges to properly terminate graph execution #4458 - Migrated codebase to exclusively use Pydantic V2, removing support for Pydantic V1 #4448
- Added ability to merge UI message props using a new
merge
parameter #4473 - Changed
TAG_NOSTREAM
from "langsmith:nostream" to "nostream", maintaining backwards compatibility #4473 - Improved docstrings and documentation throughout the codebase #4463
- Fixed UI message metadata handling in
push_ui_message
#4467
Detailed Changes
langgraph.graph.state.StateGraph
- Fixed handling of the
END
constant inget_writes
and_control_static
functions, ensuring proper graph termination when returning toEND
#4458
langgraph.graph.ui
- Added a new
merge
parameter topush_ui_message
function, allowing incremental updates to UI messages #4473 - Enhanced
ui_message_reducer
to support merging props from existing messages when themerge
flag is set #4473 - Fixed metadata handling in
push_ui_message
by removing old metadata merging which could cause unexpected behavior #4467
langgraph.constants
- Changed
TAG_NOSTREAM
from "langsmith:nostream" to "nostream" #4473 - Added
TAG_NOSTREAM_ALT
with the old value ("langsmith:nostream") for backward compatibility #4473
langgraph.graph.schema_utils
- Removed support for Pydantic V1 models in
SchemaCoercionMapper
#4448 - Simplified type adapters to work exclusively with Pydantic V2 #4448
langgraph.utils.pydantic
- Completely rewritten to use only Pydantic V2 APIs #4448
- Added proper caching for model creation with
lru_cache
for better performance #4448 - Fixed handling of reserved names and field remapping to avoid collisions with Pydantic internals #4448
langgraph.channels.base.BaseChannel
- Added docstring to clarify the purpose of this base class #4463