OpenAI Prompt Caching: Add cached_token
parameter in usage_metadata
of AI response
#27334
Closed
ShubhamMaddhashiya-bidgely
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
I too would like to see this feature in Langchain, if not already existing. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked
Feature request
OpenAI recently introduced a prompt caching feature that is automatically available for newer models. With this update, OpenAI's responses now include details on how many cached tokens were used for a request.
The current response schema includes the following structure:
Adding support for these new fields, specifically the cached_tokens parameter, would be highly beneficial for users. It would allow them to monitor caching hit rates and optimize token usage more effectively.
This enhancement would align LangChain's capabilities with OpenAI's latest API features, providing users with greater visibility into prompt efficiency and performance.
Motivation
Adding support for these new fields, specifically the cached_tokens parameter, would be highly beneficial for users. It would allow them to monitor caching hit rates and optimize token usage more effectively.
Proposal (If applicable)
I'm not sure if this enhancement is already in development, but if not, I would love to contribute to implementing this enhancement.
Beta Was this translation helpful? Give feedback.
All reactions