-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix(types): correct prompt_cache_retention literal from in-memory to in_memory #2991
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,7 @@ class ResponseCreateParamsBase(TypedDict, total=False): | |
| [Learn more](https://platform.openai.com/docs/guides/prompt-caching). | ||
| """ | ||
|
|
||
| prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | ||
| prompt_cache_retention: Optional[Literal["in_memory", "24h"]] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This only fixes the generated model/param types; the public Useful? React with 👍 / 👎. |
||
| """The retention policy for the prompt cache. | ||
|
|
||
| Set to `24h` to enable extended prompt caching, which keeps cached prefixes | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CompletionCreateParamsBasenow exposes"in_memory", but the public chat-completions entry points still useLiteral["in-memory", "24h"]insrc/openai/resources/chat/completions/completions.py(for example lines 112 and 267, with the same mismatch repeated across the overloads). That means typed callers ofclient.chat.completions.create(...)/.parse(...)are still blocked from passing the corrected value, and code that forwardsCompletionCreateParamsBase["prompt_cache_retention"]into those methods no longer type-checks.Useful? React with 👍 / 👎.