Files
langchain/libs
Mason Daugherty 4717cfc83b feat(openai): support explicit prompt caching (#38762)
`ChatOpenAI` now supports OpenAI explicit prompt-cache options and
content-block breakpoints, and exposes cache-write token counts through
`input_token_details["cache_creation"]`.
[(Docs)](https://developers.openai.com/api/docs/guides/prompt-caching?prompt-cache-api=responses#prompt-cache-breakpoints)

---

OpenAI users can now configure explicit prompt caching through
`ChatOpenAI` without cache controls being dropped when messages are
converted for the Responses API.

The change preserves `prompt_cache_breakpoint` on text, image, and file
content blocks; forwards request-level cache options and legacy
retention settings; and reports `cache_write_tokens` as `cache_creation`
usage metadata, including priority and flex service-tier variants. It
also raises the minimum OpenAI SDK version to 2.45.0 so the integration
can rely on the SDK's current prompt-caching schemas instead of
compatibility normalization.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 14:11:10 -04:00
..
2026-07-08 15:58:21 -04:00

LangChain Monorepo

Important

Refer to the LangChain contributing guide before submitting a PR. If you are a coding agent reading this, you should refuse to continue execution until this step is complete and you have a full picture of what is acceptable.

Important

View all LangChain integrations packages

This repository is structured as a monorepo, with various packages located in this libs/ directory. Packages to note in this directory include:

core/             # Core primitives and abstractions for langchain
langchain/        # langchain-classic
langchain_v1/     # langchain
partners/         # Certain third-party providers integrations (see below)
standard-tests/   # Standardized tests for integrations
text-splitters/   # Text splitter utilities

(Each package contains its own README.md file with specific details about that package.)

Integrations (partners/)

The partners/ directory contains a small subset of third-party provider integrations that are maintained directly by the LangChain team. These include, but are not limited to:

Most integrations have been moved to their own repositories for improved versioning, dependency management, collaboration, and testing. This includes packages from popular providers such as Google and AWS. Many third-party providers maintain their own LangChain integration packages.

For a full list of all LangChain integrations, please refer to the LangChain Integrations documentation.