Skip to content

Modify get_cost to account for prompt caching#911

Open
yadavsahil197 wants to merge 2 commits into
mainfrom
prompt_caching
Open

Modify get_cost to account for prompt caching#911
yadavsahil197 wants to merge 2 commits into
mainfrom
prompt_caching

Conversation

@yadavsahil197
Copy link
Copy Markdown
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