langchain-core==1.3.0a2
📦 langchainView on GitHub →
✨ 14 features🐛 35 fixes⚡ 2 deprecations🔧 17 symbols
Summary
This release focuses heavily on stability, security hardening (anti-SSRF), and improved token counting, especially for multimodal inputs and tool schemas. Several prompt loading/saving methods have been deprecated due to path validation improvements.
Migration Steps
- If using deprecated prompt saving/loading functions, update paths or migrate away from them due to path validation changes.
✨ New Features
- Added reference counting for storing inherited run trees to support garbage collection in the core.
- Added `ChatBaseten` to the serializable mapping.
- Impute placeholder filenames for OpenAI file inputs.
- Add LangSmith integration metadata to `create_agent` and `init_chat_model`.
- Harden anti-ssrf measures.
- Support tool search in OpenAI integration.
- Add `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 in token counting.
- Add multimodal support to `count_tokens_approximately`.
- Add XML format option for `get_buffer_string`.
🐛 Bug Fixes
- 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.
- Fixed typos in the documentation.
- Add "computer" to `_WellKnownOpenAITools`.
- Validate paths in `prompt.save` and `load_prompt`.
- Add missing `ModelProfile` fields, warn on schema drift.
- Trace invocation params in metadata (reverted and then re-applied/fixed).
- 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_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.
- Replace bare except with `Exception` in tracer.
- Adjust cap when scaling approximate token counts.
- Apply cap when scaling approximate token counts.
- Prevent crash in ParrotFakeChatModel when messages list is empty.
- Google docstring parsing with no arguments/reserved arguments fixed.
- 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`.
- Fix nested mustache variable extraction and update docs.
- Allow base model annotations for empty model.
Affected Symbols
⚡ Deprecations
- Validation and serialization mappings for Bedrock models were added, implying potential changes to how these models are handled.
- Methods in `prompt.save` and `load_prompt` were deprecated due to path validation changes related to symlinks and hardening checks for txt files.