Change8

langchain-core==1.3.0a1

📦 langchainView on GitHub →
13 features🐛 35 fixes2 deprecations🔧 20 symbols

Summary

This release focuses heavily on stability, security hardening (anti-SSRF, pygments update), and feature parity, including adding Bedrock and OpenRouter support, and enhancing token counting for multimodal inputs and tool schemas. Several internal cleanups and deprecations related to prompt saving paths were also introduced.

Migration Steps

  1. Ensure `pygments` is at least version 2.20.0 to address CVE-2026-4539.
  2. Review usage of prompt saving/loading functions if relying on deprecated paths or symlinks.

✨ New Features

  • Added `ChatBaseten` to the serializable mapping.
  • Impute placeholder filenames for OpenAI file inputs.
  • Added LangSmith integration metadata to `create_agent` and `init_chat_model`.
  • Hardened anti-SSRF measures.
  • Support for tool search in OpenAI integrations.
  • Added `ChatAnthropicBedrock` wrapper.
  • Added `langchain-openrouter` provider package.
  • Added `ContextOverflowError` and raised it in Anthropic and OpenAI integrations.
  • Added `text_inputs` and `text_outputs` to model profiles.
  • Count tokens from tool schemas in `count_tokens_approximately`.
  • Allow scaling by reported usage when counting tokens approximately.
  • Added multimodal support to `count_tokens_approximately`.
  • Added XML format option for `get_buffer_string`.

🐛 Bug Fixes

  • Added more sanitization to templates.
  • Handle symlinks in deprecated prompt save path.
  • Added init validator and serialization mappings for Bedrock models.
  • Corrected parameter names in `filter_messages` docstring example.
  • Harden check for txt files in deprecated prompt loading functions.
  • Fixed typos in the documentation.
  • Added "computer" to `_WellKnownOpenAITools`.
  • Validate paths in `prompt.save` and `load_prompt`.
  • Add missing `ModelProfile` fields and warn on schema drift.
  • Trace invocation params in metadata (reverted and then fixed again, final state implies fix is present).
  • Fixed double backticks in deprecation docstring for `alternative_import`.
  • Preserve `default_factory` when generating tool call schema.
  • Extract usage metadata from serialized tracer message outputs.
  • Treat empty tool chunk ids as missing in merge.
  • Improve error message for non-JSON-serializable tool schemas.
  • Improve typing/docs for `on_chat_model_start` to clarify required positional args.
  • Fix `merge_lists` incorrectly merging parallel tool calls.
  • Accept integer temperature values in `_get_ls_params` for LangSmith tracing.
  • Prevent recursion error when `args_schema` is a dict.
  • Preserve index and timestamp fields when merging.
  • Correct misleading jinja2 sandboxing comment.
  • Fix setting `ChatGeneration.text`.
  • Sanitize urls when counting tokens in images.
  • Replace bare except with `Exception` in tracer.
  • Adjust cap when scaling approximate token counts.
  • Apply cap when scaling approximate token counts.
  • Fix nested mustache variable extraction and update docs.
  • Allow base model annotations for empty model.
  • Prevent crash in `ParrotFakeChatModel` when messages list is empty.
  • Google docstring parsing with no arguments/reserved arguments.
  • Replace `Iterable` with `Iterator` for block iteration.
  • `yield_blobs` returns `Iterator`.
  • Raise `OutputParserException` for unknown tools.
  • Fix typo 'use a a' -> 'use as a' in `check_version.py`.
  • Correctly guard against non-text-block types.

Affected Symbols

⚡ Deprecations

  • Deprecation of prompt save/load paths that rely on symlinks or non-hardened checks for txt files.
  • Deprecation of prompt saving/loading methods due to path validation issues.