Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/openai/types/chat/completion_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class CompletionCreateParamsBase(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"]]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep chat completion method signatures in sync with this literal

CompletionCreateParamsBase now exposes "in_memory", but the public chat-completions entry points still use Literal["in-memory", "24h"] in src/openai/resources/chat/completions/completions.py (for example lines 112 and 267, with the same mismatch repeated across the overloads). That means typed callers of client.chat.completions.create(...)/.parse(...) are still blocked from passing the corrected value, and code that forwards CompletionCreateParamsBase["prompt_cache_retention"] into those methods no longer type-checks.

Useful? React with 👍 / 👎.

"""The retention policy for the prompt cache.

Set to `24h` to enable extended prompt caching, which keeps cached prefixes
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/responses/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Response(BaseModel):
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
"""

prompt_cache_retention: Optional[Literal["in-memory", "24h"]] = None
prompt_cache_retention: Optional[Literal["in_memory", "24h"]] = None
"""The retention policy for the prompt cache.

Set to `24h` to enable extended prompt caching, which keeps cached prefixes
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/responses/response_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update public Responses overloads to accept in_memory

This only fixes the generated model/param types; the public Responses.create signatures still declare Literal["in-memory", "24h"] in src/openai/resources/responses/responses.py (for example line 130, and the same literal is repeated in the other overloads in that file). In a typed codebase, client.responses.create(prompt_cache_retention="in_memory") still fails pyright/mypy, and forwarding a ResponseCreateParamsBase["prompt_cache_retention"] value into Responses.create is now an incompatible call even though "in_memory" is the API-accepted value.

Useful? React with 👍 / 👎.

"""The retention policy for the prompt cache.

Set to `24h` to enable extended prompt caching, which keeps cached prefixes
Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/responses/responses_client_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class ResponsesClientEvent(BaseModel):
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
"""

prompt_cache_retention: Optional[Literal["in-memory", "24h"]] = None
prompt_cache_retention: Optional[Literal["in_memory", "24h"]] = None
"""The retention policy for the prompt cache.

Set to `24h` to enable extended prompt caching, which keeps cached prefixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class ResponsesClientEventParam(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"]]
"""The retention policy for the prompt cache.

Set to `24h` to enable extended prompt caching, which keeps cached prefixes
Expand Down