Document explicit prompt caching support in ChatOpenAI#4829
Draft
langsmith-fleet[bot] wants to merge 1 commit into
Draft
Document explicit prompt caching support in ChatOpenAI#4829langsmith-fleet[bot] wants to merge 1 commit into
langsmith-fleet[bot] wants to merge 1 commit into
Conversation
Contributor
|
Mintlify preview branch generated: Site preview: https://langchain-5e9cc07a-preview-docsop-1783712953-3d6265d.mintlify.app Important Preview links may take a few minutes to start working while the deployment finishes. Changed documentation pages (preview deep links): |
| ### Explicit caching with breakpoints (Responses API) | ||
|
|
||
| <Note> | ||
| Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api). |
There was a problem hiding this comment.
Suggested change
| Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api). | |
| Requires `langchain-openai>=1.3.5`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api). |
There was a problem hiding this comment.
this is done transitively
| ### Explicit caching with breakpoints (Responses API) | ||
|
|
||
| <Note> | ||
| Requires `langchain-openai>=1.3.5` and `openai>=2.45.0`. Only supported when using the [Responses API](/oss/python/integrations/chat/openai#responses-api). |
There was a problem hiding this comment.
Only supported when using the Responses API.
need to verify this claim
| ```python | ||
| from langchain_openai import ChatOpenAI | ||
|
|
||
| llm = ChatOpenAI(model="gpt-4.1", use_responses_api=True) |
There was a problem hiding this comment.
Suggested change
| llm = ChatOpenAI(model="gpt-4.1", use_responses_api=True) | |
| llm = ChatOpenAI(model="gpt-5.6-sol", use_responses_api=True) |
need to verify model string
don't think 4.1 supports
|
|
||
| ```python | ||
| llm = ChatOpenAI( | ||
| model="gpt-4.1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes DOC-1363
Summary
prompt_cache_breakpointfield on text, image, and file content blocksprompt_cache_optionsmodel parametercache_creationininput_token_detailsusage metadata, including priority/flex service-tier variantsThese features were added in langchain-ai/langchain#38762 (
langchain-openai>=1.3.5,openai>=2.45.0).Links
Verification
Cross-references checked:
make check-cross-refspassed ✅. Vale not available in sandbox (brew dependency), but the content is prose-only additions with no structural changes.Reviewers
Requested review from: Mason Daugherty (@mdrxy) (integrations owner)