Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify get_cost to account for prompt caching #911

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yadavsahil197
Copy link
Contributor

OpenAI supports prompt caching by default for gpt-4o-2024-08-06 and gpt-4o-mini-2024-07-18.
When using the cached prompts, it'll automatically apply 50% discount to the cached prompt tokens.
Making that adjustment to the get_cost to account for this discount.

Testing:
Tested using model gpt-4o-2024-08-06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant