pypi / langchain-core
langchain-core
What changed in langchain-core 0.3 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.
13 breaking17 security7 deprecations38 new APIs and options4 performance21 behavior and defaults1 tooling119 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlangchain-core 1216 changes
Breaking changes 12
Serialization fails fast when tool schemas cannot resolve forward references.
Strict tool schemas require all nested properties.
Raises ValueError when explicit tool_outputs length mismatches tool_calls.
Deletes BaseMemory from langchain-core and moves it to langchain-classic.
Removes get_relevant_documents.
Reverts the fix for tracing invocation parameters in metadata, changing what invocation data is recorded there.
Moves BaseCrossEncoder into langchain-core.
Unknown tools now raise an output parser exception.
Makes the prefix argument keyword-only to match BaseStore.
The approximate alias is added in place of count_tokens_approximately.
The functionality supported by jinja2 and mustache templates was restricted.
Automatically sets required to include all properties in strict mode.
Security 15
Hardened scoped and compatible IPv6 SSRF checks.
Guards against malformed Anthropic content blocks.
Streaming callback options are redacted.
Hardens checks for text files in deprecated prompt loading functions.
Hardens deserialization against untrusted manifests.
Private SSRF utilities were hardened.
LangChain has incomplete f-string validation in prompt templates
Templates receive additional sanitization.
Hardened the check for txt files in deprecated prompt loading functions, resolving a symlink resolution issue.
Validates paths in load_prompt, helping prevent invalid paths from being used when loading prompts.
Validates paths in prompt.save, helping prevent invalid paths from being used when saving prompts.
Hardens protection against server-side request forgery.
URLs are sanitized when counting tokens in images.
LangChain serialization injection vulnerability enables secret extraction in dumps/loads APIs
Validation for input variables in f-string templates was fixed.
Deprecations 7
Chat message history is deprecated.
The problematic dict() method is deprecated.
Validates paths in prompt.save and load_prompt, and deprecates the methods.
The load_prompt method is deprecated.
The prompt.save method is deprecated.
A warning is added for fallback GPT-2 tokenizer usage.
py_anext is deprecated in favor of anext.
New APIs and options 38
LangChainTracer now accepts an address.
Model profiles can declare mid-conversation support.
with_retry now accepts a callable.
Model name and provider tracing metadata can be overridden based on the gateway response.
OpenAI integration supports async tools.
Standard model exception types are available for handling model errors.
Anthropic, Fireworks, and OpenAI integrations support the LangSmith gateway through an environment variable.
Adds reasoning_effort as a standard chat model parameter.
Callbacks now support content block tokens.
Adds support for the OpenAI built-in apply_patch tool.
Adds approximate as an alias for count_tokens_approximately.
Adds the ChatAnthropicBedrock wrapper.
Adds an optional include_id parameter.
Adds an XML format option and support for a custom message separator.
Creates the langchain-model-profiles package and adds a profile property to BaseChatModel.
Supports tool runtime injection with custom argument schemas and generic ToolRuntime types.
Adds content-block-centric streaming (v2).
Adds chat model and LLM invocation parameters to traceable metadata.
Adds ChatBaseten to the serializable mapping.
Adds support for tool search.
Adds the OpenRouter provider package for developers integrating OpenRouter with LangChain.
Adds ContextOverflowError, raised in Anthropic and OpenAI integrations.
Adds text_inputs to model profiles.
Adds text_outputs to model profiles.
Approximate token counts can now be scaled by reported usage.
Adds an XML format option for rendering the buffer string.
Sync methods now have an explicit tags parameter.
Supports a custom message separator when converting messages to a buffer string.
Supports (message class, template) tuples in from_messages.
The decorator supports the PEP 702 __deprecated__ attribute.
Adds usage_metadata to metadata in LangChainTracer.
Adds extras to BaseTool, enabling additional tool metadata.
The genai block translator now supports Google Maps grounding.
Mermaid PNG rendering supports proxies.
Adds support for drawing subgraphs using pygraphviz.
Adds a profile property to BaseChatModel.
Adds the langchain-model-profiles package for model profiles.
Messages gain a provider-agnostic content_blocks property for accessing standardized content such as reasoning, citations, and tool calls.
Performance 4
The transformers package is imported lazily.
Memoizes the subset model for the tool-call schema, improving performance when accessing it.
Caches model_json_schema results to improve performance.
Specific langsmith imports are deferred to reduce import time.
Behavior and default changes 21
Gateway information is propagated on the error path.
The function handles callables and non-dict mappings.
Mustache templates accept non-dict Mapping values.
Gateway metadata is incorporated into traces, making that metadata available in trace data.
Package versions are tracked in tracing metadata.
Tool error content can now be provided as a sequence.
Counts tokens from tool schemas and supports multimodal messages; can scale counts by reported usage and applies a cap when scaling.
Marks stream_v2 and astream_v2 as beta.
astream_v2 is marked as beta.
stream_v2 is marked as beta.
Allows a list of ToolOutputMixin instances to pass through.
Updates inheritance behavior for tracer metadata for special keys.
Imputes placeholder filenames for OpenAI file inputs.
Adds LangSmith integration metadata to create_agent.
Adds LangSmith integration metadata to init_chat_model.
Includes tool schemas when approximately counting tokens.
Approximate token counting supports multimodal messages.
HTML link extraction ignores more file extensions.
Tool call counts and their metadata are counted and stored automatically.
Uses uuid7 for run IDs.
Tool runtime injection is supported when a custom args schema is provided.
Tooling 1
Typing for Runnable.__or__ is improved.
Fixes and other changes 118
Extras are now propagated on content-block-start events.
Hardens handling around inspect.signature for Python 3.14.
Includes OpenAI redacted_content in v1 output for Bedrock Converse.
Adds compatibility with Claude Sonnet 5.5 for developers using the Anthropic integration.
Long tool IDs are abbreviated in XML buffer strings.
Avoids mutation in Bedrock Converse standard content.
Avoids mutation in Google GenAI standard content.
Indexing in genai v1 streaming content was fixed.
StructuredTool was made JSON-serializable.
Chain-group runs are finalized when a BaseException is raised.
RunnablePick instances can now be deserialized.
Postponed annotations are resolved when determining injected argument keys.
Now handles None and zero sizes consistently with batch_iterate.
Fixes issues in merging chunks.
Preserves non-string, non-dictionary items in list values.
Fixes handling of tool descriptions when infer_schema is false.
Handles falsy LLM and chat model caches.
Validation now respects Pydantic aliases for tool inputs.
Clears the callback when an exception occurs in the context manager.
Handles v1 base model validation in the async path.
Injected arguments are handled for subclasses of BaseTool.
filter_args respects include_injected=False.
OpenAI file blocks are preserved.
Compatibility with pydantic 2.14 was fixed.
Runables using RootModel preserve a flat tool args schema.
Streaming tracers close event loops they create internally.
StructuredPrompt no longer mutates caller kwargs.
Text stream projections have corrected types.
The gateway now falls back to LANGSMITH_API_KEY for authentication.
Handles empty strings in gateway environment variables.
Uses the tool_call_schema cache for BaseTool token counting.
Uses
asyncio.get_running_loop()in async contexts.Improved error messages from LangSmith loaders, making loader failures clearer to developers.
Fixed handling of continuation lines containing colons when parsing Google-style docstrings.
Added messages to bare
raise ValueErrorcalls, making these errors more informative.Fixed bugs in XML and Pydantic output parsers.
Preserves usage token details in v3 streaming events.
The package version trace metadata was renamed.
Pydantic v1 support in tools/runnable was fixed.
Normalize v1 streamed tool calls.
Fixes the async tracer fallback for on_chat_model_start when called in a sync context.
Tightens structured output model fallbacks.
The output type of structured tool error handlers is fixed.
Accepts the Serializable constructor-envelope wire shape.
Removes Bedrock prevalidation from load.
Preserves reasoning blocks alongside tool_call in the v3 stream.
Preserves chunk additional_kwargs across v3 stream assembly.
Adds add_user_message and add_ai_message back.
Avoids eagerly importing pydantic.v1 when using the deprecated decorator.
Fixes string content when streaming with output_version="v1".
Adds support for Python 3.14, including TypedDict compatibility using get_type_hints.
Delegates to the core implementation on invoke when streaming=True.
Includes tool_call_id in on_tool_error event data and passes it to on_tool_start callbacks.
Validates batch_size in _batch and _abatch to prevent an infinite loop.
Preserves structured inputs on tool runs in tracers.
Makes the removal argument optional.
Handles response content blocks that lack a type key during conversion.
Restores cloud metadata IPs and the link-local range in the SSRF policy.
Handles symlinks in the deprecated prompt save path.
Adds an initialization validator and serialization mappings for Bedrock models.
Adds computer to the set of well-known OpenAI tools.
Adds missing ModelProfile fields and warns on schema drift.
Invocation parameters are now traced in metadata.
Tool call schema generation now preserves default_factory.
Usage metadata is now extracted from serialized tracer message outputs.
Empty tool chunk IDs are treated as missing during merge.
Typing and documentation clarify that on_chat_model_start requires positional arguments.
Error messages for non-JSON-serializable tool schemas are improved, making these failures easier to understand.
Prevents a recursion error when args_schema is a dict.
Accepts integer temperature values for LangSmith tracing.
Fixes incorrect merging of parallel tool calls.
Preserves index and timestamp fields when merging.
Fixes setting ChatGeneration.text.
The tracer now catches Exception instead of using a bare except.
The cap is applied and adjusted when scaling approximate token counts.
Base model annotations are allowed for an empty model.
Block iteration uses Iterator instead of Iterable.
Fixes parsing when docstrings have no arguments or reserved arguments.
Improves the error message when a title is missing.
Nested Mustache variable extraction is fixed.
Correctly guards against non-text-block types.
The event data now includes tool_call_id.
Prevents a crash when the messages list is empty.
The return type is Iterator.
Injected arguments found only in a tool signature are no longer traced.
Injected arguments are excluded from tool schemas.
Message IDs are stripped from cache keys using model_copy.
Strict schema generation is fixed for functions with optional arguments.
URL-encodes the bgColor parameter in mermaid API calls.
Fixes callback manager merging that mixed handlers.
Default arguments are populated from a tool's args_schema.
Uses tool_calls instead of the deprecated function_call when formatting messages.
The return types of RunnablePick methods were fixed.
A serialization issue was fixed.
The decorator now preserves descriptions supplied through Field(description=...).
tool_call_count is ensured to never be null.
Trace persistence is deferred for iterator inputs.
Allows unknown blocks in convert_to_openai_messages.
Uses get_type_hints for Python 3.14 TypedDict compatibility.
Handles None arguments in parse_tool_call.
The conversion input type was widened to Mapping, allowing mapping inputs.
Jinja2 restrictions were undone, changing the restrictions applied when using Jinja2.
Prevents async tasks from being garbage-collected.
The callback now receives tool_call_id.
Uses ensure_ascii=False when formatting exceptions.
Handles a missing schema for StructuredPrompt.
Fixes a tool call ID bug introduced with runtime injection.
Exceptions are no longer masked, so callers can observe the original exception.
Empty content blocks are filtered from formatted prompts.
Fixes tool name checking in name_dict.
Fixes empty parallel schemas when child runnable input schemas use TypedDict.
Fixes the case where RunnablePick may not return a dict when keys is a string.
Preserves context in shielded async callbacks.
JSON get_format_instructions is improved using Opik Agent Optimizer.
PydanticOutputParser format instructions are fixed for v1 models.
Google GenAI text blocks are translated to v1.
Injected arguments are filtered out from tracing.
Schema handling is more defensive.
langchain-core 0.34 changes
Breaking changes 1
Run IDs now use UUID7, changing the format of generated run identifiers.
Security 2
Backports the path-traversal fix to v0.3.
Prompts are sanitized more thoroughly.
Fixes and other changes 1
A serialization patch was included; the notes do not specify further details.