Change8

langchain-core==1.3.0a3

📦 langchainView on GitHub →
12 features🐛 37 fixes1 deprecations🔧 12 symbols

Summary

This release introduces new features like enhanced metadata tracing, support for ChatBaseten, and multimodal token counting. It also includes numerous bug fixes related to SSRF hardening, model serialization, and tool handling, alongside the deprecation of prompt saving/loading functions due to added path validation.

Migration Steps

  1. If you rely on path validation in `prompt.save` or `load_prompt`, ensure paths are valid, as these functions are now deprecated.

✨ New Features

  • Added chat model and LLM invocation parameters to traceable metadata.
  • Added `ChatBaseten` to the serializable mapping.
  • Impute placeholder filenames for OpenAI file inputs.
  • Support tool search in OpenAI integration.
  • Add LangSmith integration metadata to `create_agent` and `init_chat_model`.
  • Added `ChatAnthropicBedrock` wrapper.
  • Add `langchain-openrouter` provider package.
  • Add `ContextOverflowError` and raise it in Anthropic and OpenAI integrations.
  • Add `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.
  • Add multimodal support to `count_tokens_approximately`.

🐛 Bug Fixes

  • Restore cloud metadata IPs and link-local range in SSRF policy.
  • Handle content blocks without a type key in responses API conversion (openai).
  • Use reference counting for storing inherited run trees to support garbage collection.
  • Add more sanitization to templates.
  • Handle symlinks in deprecated prompt save path.
  • Add init validator and serialization mappings for Bedrock models.
  • Correct parameter names in `filter_messages` docstring example.
  • Harden check for txt files in deprecated prompt loading functions.
  • Add "computer" to `_WellKnownOpenAITools`.
  • Validate paths in `prompt.save` and `load_prompt` (leading to deprecation).
  • Add missing `ModelProfile` fields and warn on schema drift.
  • Trace invocation params in metadata (reverted and then fixed again).
  • Fix 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 int temperature in `_get_ls_params` for LangSmith tracing.
  • Accept integer temperature values in `_get_ls_params`.
  • Prevent recursion error when `args_schema` is dict.
  • Preserve index and timestamp fields when merging.
  • Correct misleading jinja2 sandboxing comment.
  • Fix setting `ChatGeneration.text`.
  • Sanitize urls when counting tokens in images (openai).
  • 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_v.

Affected Symbols

⚡ Deprecations

  • Validation of paths in `prompt.save` and `load_prompt` functions has been added, and these methods are now deprecated.