Commit ac534dcd
Changed files (60)
src
openai
lib
_parsing
resources
beta
threads
runs
chat
completions
responses
types
conversations
evals
responses
shared_params
tests
api_resources
beta
responses
src/openai/lib/_parsing/_responses.py
@@ -108,6 +108,10 @@ def parse_response(
or output.type == "image_generation_call"
or output.type == "code_interpreter_call"
or output.type == "local_shell_call"
+ or output.type == "shell_call"
+ or output.type == "shell_call_output"
+ or output.type == "apply_patch_call"
+ or output.type == "apply_patch_call_output"
or output.type == "mcp_list_tools"
or output.type == "exec"
or output.type == "custom_tool_call"
src/openai/resources/beta/threads/runs/runs.py
@@ -169,12 +169,16 @@ class Runs(SyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -326,12 +330,16 @@ class Runs(SyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -479,12 +487,16 @@ class Runs(SyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -1608,12 +1620,16 @@ class AsyncRuns(AsyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -1765,12 +1781,16 @@ class AsyncRuns(AsyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -1918,12 +1938,16 @@ class AsyncRuns(AsyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
src/openai/resources/beta/assistants.py
@@ -98,12 +98,16 @@ class Assistants(SyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -308,12 +312,16 @@ class Assistants(SyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -557,12 +565,16 @@ class AsyncAssistants(AsyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -767,12 +779,16 @@ class AsyncAssistants(AsyncAPIResource):
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
src/openai/resources/chat/completions/completions.py
@@ -102,6 +102,7 @@ class Completions(SyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
safety_identifier: str | Omit = omit,
seed: Optional[int] | Omit = omit,
@@ -201,6 +202,7 @@ class Completions(SyncAPIResource):
"prediction": prediction,
"presence_penalty": presence_penalty,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning_effort": reasoning_effort,
"response_format": _type_to_response_format(response_format),
"safety_identifier": safety_identifier,
@@ -255,6 +257,7 @@ class Completions(SyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -401,14 +404,23 @@ class Completions(SyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: An object specifying the format that the model must output.
@@ -547,6 +559,7 @@ class Completions(SyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -701,14 +714,23 @@ class Completions(SyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: An object specifying the format that the model must output.
@@ -838,6 +860,7 @@ class Completions(SyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -992,14 +1015,23 @@ class Completions(SyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: An object specifying the format that the model must output.
@@ -1128,6 +1160,7 @@ class Completions(SyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -1174,6 +1207,7 @@ class Completions(SyncAPIResource):
"prediction": prediction,
"presence_penalty": presence_penalty,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning_effort": reasoning_effort,
"response_format": response_format,
"safety_identifier": safety_identifier,
@@ -1407,6 +1441,7 @@ class Completions(SyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
safety_identifier: str | Omit = omit,
seed: Optional[int] | Omit = omit,
@@ -1477,6 +1512,7 @@ class Completions(SyncAPIResource):
prediction=prediction,
presence_penalty=presence_penalty,
prompt_cache_key=prompt_cache_key,
+ prompt_cache_retention=prompt_cache_retention,
reasoning_effort=reasoning_effort,
safety_identifier=safety_identifier,
seed=seed,
@@ -1549,6 +1585,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
safety_identifier: str | Omit = omit,
seed: Optional[int] | Omit = omit,
@@ -1648,6 +1685,7 @@ class AsyncCompletions(AsyncAPIResource):
"prediction": prediction,
"presence_penalty": presence_penalty,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning_effort": reasoning_effort,
"response_format": _type_to_response_format(response_format),
"safety_identifier": safety_identifier,
@@ -1702,6 +1740,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -1848,14 +1887,23 @@ class AsyncCompletions(AsyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: An object specifying the format that the model must output.
@@ -1994,6 +2042,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -2148,14 +2197,23 @@ class AsyncCompletions(AsyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: An object specifying the format that the model must output.
@@ -2285,6 +2343,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -2439,14 +2498,23 @@ class AsyncCompletions(AsyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning_effort: Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
response_format: An object specifying the format that the model must output.
@@ -2575,6 +2643,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
response_format: completion_create_params.ResponseFormat | Omit = omit,
safety_identifier: str | Omit = omit,
@@ -2621,6 +2690,7 @@ class AsyncCompletions(AsyncAPIResource):
"prediction": prediction,
"presence_penalty": presence_penalty,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning_effort": reasoning_effort,
"response_format": response_format,
"safety_identifier": safety_identifier,
@@ -2854,6 +2924,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction: Optional[ChatCompletionPredictionContentParam] | Omit = omit,
presence_penalty: Optional[float] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning_effort: Optional[ReasoningEffort] | Omit = omit,
safety_identifier: str | Omit = omit,
seed: Optional[int] | Omit = omit,
@@ -2925,6 +2996,7 @@ class AsyncCompletions(AsyncAPIResource):
prediction=prediction,
presence_penalty=presence_penalty,
prompt_cache_key=prompt_cache_key,
+ prompt_cache_retention=prompt_cache_retention,
reasoning_effort=reasoning_effort,
safety_identifier=safety_identifier,
seed=seed,
src/openai/resources/responses/responses.py
@@ -100,6 +100,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -215,6 +216,11 @@ class Responses(SyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning: **gpt-5 and o-series models only**
Configuration options for
@@ -340,6 +346,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -461,6 +468,11 @@ class Responses(SyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning: **gpt-5 and o-series models only**
Configuration options for
@@ -579,6 +591,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -700,6 +713,11 @@ class Responses(SyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning: **gpt-5 and o-series models only**
Configuration options for
@@ -816,6 +834,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -854,6 +873,7 @@ class Responses(SyncAPIResource):
"previous_response_id": previous_response_id,
"prompt": prompt,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning": reasoning,
"safety_identifier": safety_identifier,
"service_tier": service_tier,
@@ -915,6 +935,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -954,6 +975,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -987,6 +1009,7 @@ class Responses(SyncAPIResource):
"previous_response_id": previous_response_id,
"prompt": prompt,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning": reasoning,
"safety_identifier": safety_identifier,
"service_tier": service_tier,
@@ -1040,6 +1063,7 @@ class Responses(SyncAPIResource):
previous_response_id=previous_response_id,
prompt=prompt,
prompt_cache_key=prompt_cache_key,
+ prompt_cache_retention=prompt_cache_retention,
store=store,
stream_options=stream_options,
stream=True,
@@ -1098,6 +1122,7 @@ class Responses(SyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -1155,6 +1180,7 @@ class Responses(SyncAPIResource):
"previous_response_id": previous_response_id,
"prompt": prompt,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning": reasoning,
"safety_identifier": safety_identifier,
"service_tier": service_tier,
@@ -1535,6 +1561,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -1650,6 +1677,11 @@ class AsyncResponses(AsyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning: **gpt-5 and o-series models only**
Configuration options for
@@ -1775,6 +1807,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -1896,6 +1929,11 @@ class AsyncResponses(AsyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning: **gpt-5 and o-series models only**
Configuration options for
@@ -2014,6 +2052,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -2135,6 +2174,11 @@ class AsyncResponses(AsyncAPIResource):
hit rates. Replaces the `user` field.
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
+ prompt_cache_retention: The retention policy for the prompt cache. Set to `24h` to enable extended
+ prompt caching, which keeps cached prefixes active for longer, up to a maximum
+ of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+
reasoning: **gpt-5 and o-series models only**
Configuration options for
@@ -2251,6 +2295,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -2289,6 +2334,7 @@ class AsyncResponses(AsyncAPIResource):
"previous_response_id": previous_response_id,
"prompt": prompt,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning": reasoning,
"safety_identifier": safety_identifier,
"service_tier": service_tier,
@@ -2350,6 +2396,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -2389,6 +2436,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -2422,6 +2470,7 @@ class AsyncResponses(AsyncAPIResource):
"previous_response_id": previous_response_id,
"prompt": prompt,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning": reasoning,
"safety_identifier": safety_identifier,
"service_tier": service_tier,
@@ -2476,6 +2525,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id=previous_response_id,
prompt=prompt,
prompt_cache_key=prompt_cache_key,
+ prompt_cache_retention=prompt_cache_retention,
store=store,
stream_options=stream_options,
temperature=temperature,
@@ -2538,6 +2588,7 @@ class AsyncResponses(AsyncAPIResource):
previous_response_id: Optional[str] | Omit = omit,
prompt: Optional[ResponsePromptParam] | Omit = omit,
prompt_cache_key: str | Omit = omit,
+ prompt_cache_retention: Optional[Literal["in-memory", "24h"]] | Omit = omit,
reasoning: Optional[Reasoning] | Omit = omit,
safety_identifier: str | Omit = omit,
service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]] | Omit = omit,
@@ -2595,6 +2646,7 @@ class AsyncResponses(AsyncAPIResource):
"previous_response_id": previous_response_id,
"prompt": prompt,
"prompt_cache_key": prompt_cache_key,
+ "prompt_cache_retention": prompt_cache_retention,
"reasoning": reasoning,
"safety_identifier": safety_identifier,
"service_tier": service_tier,
src/openai/resources/batches.py
@@ -46,7 +46,9 @@ class Batches(SyncAPIResource):
self,
*,
completion_window: Literal["24h"],
- endpoint: Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
+ endpoint: Literal[
+ "/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/moderations"
+ ],
input_file_id: str,
metadata: Optional[Metadata] | Omit = omit,
output_expires_after: batch_create_params.OutputExpiresAfter | Omit = omit,
@@ -65,9 +67,10 @@ class Batches(SyncAPIResource):
is supported.
endpoint: The endpoint to be used for all requests in the batch. Currently
- `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions`
- are supported. Note that `/v1/embeddings` batches are also restricted to a
- maximum of 50,000 embedding inputs across all requests in the batch.
+ `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`,
+ and `/v1/moderations` are supported. Note that `/v1/embeddings` batches are also
+ restricted to a maximum of 50,000 embedding inputs across all requests in the
+ batch.
input_file_id: The ID of an uploaded file that contains requests for the new batch.
@@ -261,7 +264,9 @@ class AsyncBatches(AsyncAPIResource):
self,
*,
completion_window: Literal["24h"],
- endpoint: Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"],
+ endpoint: Literal[
+ "/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/moderations"
+ ],
input_file_id: str,
metadata: Optional[Metadata] | Omit = omit,
output_expires_after: batch_create_params.OutputExpiresAfter | Omit = omit,
@@ -280,9 +285,10 @@ class AsyncBatches(AsyncAPIResource):
is supported.
endpoint: The endpoint to be used for all requests in the batch. Currently
- `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions`
- are supported. Note that `/v1/embeddings` batches are also restricted to a
- maximum of 50,000 embedding inputs across all requests in the batch.
+ `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, `/v1/completions`,
+ and `/v1/moderations` are supported. Note that `/v1/embeddings` batches are also
+ restricted to a maximum of 50,000 embedding inputs across all requests in the
+ batch.
input_file_id: The ID of an uploaded file that contains requests for the new batch.
src/openai/types/beta/threads/run_create_params.py
@@ -111,12 +111,16 @@ class RunCreateParamsBase(TypedDict, total=False):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
response_format: Optional[AssistantResponseFormatOptionParam]
src/openai/types/beta/assistant_create_params.py
@@ -62,12 +62,16 @@ class AssistantCreateParams(TypedDict, total=False):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
response_format: Optional[AssistantResponseFormatOptionParam]
src/openai/types/beta/assistant_update_params.py
@@ -97,12 +97,16 @@ class AssistantUpdateParams(TypedDict, total=False):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
response_format: Optional[AssistantResponseFormatOptionParam]
src/openai/types/chat/completion_create_params.py
@@ -185,16 +185,28 @@ class CompletionCreateParamsBase(TypedDict, total=False):
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
"""
+ 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
+ active for longer, up to a maximum of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+ """
+
reasoning_effort: Optional[ReasoningEffort]
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
response_format: ResponseFormat
src/openai/types/conversations/conversation_item.py
@@ -10,12 +10,16 @@ from ..responses.response_reasoning_item import ResponseReasoningItem
from ..responses.response_custom_tool_call import ResponseCustomToolCall
from ..responses.response_computer_tool_call import ResponseComputerToolCall
from ..responses.response_function_web_search import ResponseFunctionWebSearch
+from ..responses.response_apply_patch_tool_call import ResponseApplyPatchToolCall
from ..responses.response_file_search_tool_call import ResponseFileSearchToolCall
from ..responses.response_custom_tool_call_output import ResponseCustomToolCallOutput
from ..responses.response_function_tool_call_item import ResponseFunctionToolCallItem
+from ..responses.response_function_shell_tool_call import ResponseFunctionShellToolCall
from ..responses.response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall
+from ..responses.response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput
from ..responses.response_computer_tool_call_output_item import ResponseComputerToolCallOutputItem
from ..responses.response_function_tool_call_output_item import ResponseFunctionToolCallOutputItem
+from ..responses.response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput
__all__ = [
"ConversationItem",
@@ -211,6 +215,10 @@ ConversationItem: TypeAlias = Annotated[
ResponseCodeInterpreterToolCall,
LocalShellCall,
LocalShellCallOutput,
+ ResponseFunctionShellToolCall,
+ ResponseFunctionShellToolCallOutput,
+ ResponseApplyPatchToolCall,
+ ResponseApplyPatchToolCallOutput,
McpListTools,
McpApprovalRequest,
McpApprovalResponse,
src/openai/types/evals/create_eval_completions_run_data_source.py
@@ -172,12 +172,16 @@ class SamplingParams(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
response_format: Optional[SamplingParamsResponseFormat] = None
src/openai/types/evals/create_eval_completions_run_data_source_param.py
@@ -168,12 +168,16 @@ class SamplingParams(TypedDict, total=False):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
response_format: SamplingParamsResponseFormat
src/openai/types/evals/run_cancel_response.py
@@ -103,12 +103,16 @@ class DataSourceResponsesSourceResponses(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
temperature: Optional[float] = None
@@ -241,12 +245,16 @@ class DataSourceResponsesSamplingParams(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: Optional[int] = None
src/openai/types/evals/run_create_params.py
@@ -116,12 +116,16 @@ class DataSourceCreateEvalResponsesRunDataSourceSourceResponses(TypedDict, total
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
temperature: Optional[float]
@@ -259,12 +263,16 @@ class DataSourceCreateEvalResponsesRunDataSourceSamplingParams(TypedDict, total=
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: int
src/openai/types/evals/run_create_response.py
@@ -103,12 +103,16 @@ class DataSourceResponsesSourceResponses(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
temperature: Optional[float] = None
@@ -241,12 +245,16 @@ class DataSourceResponsesSamplingParams(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: Optional[int] = None
src/openai/types/evals/run_list_response.py
@@ -103,12 +103,16 @@ class DataSourceResponsesSourceResponses(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
temperature: Optional[float] = None
@@ -241,12 +245,16 @@ class DataSourceResponsesSamplingParams(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: Optional[int] = None
src/openai/types/evals/run_retrieve_response.py
@@ -103,12 +103,16 @@ class DataSourceResponsesSourceResponses(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
temperature: Optional[float] = None
@@ -241,12 +245,16 @@ class DataSourceResponsesSamplingParams(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: Optional[int] = None
src/openai/types/graders/score_model_grader.py
@@ -67,12 +67,16 @@ class SamplingParams(BaseModel):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: Optional[int] = None
src/openai/types/graders/score_model_grader_param.py
@@ -73,12 +73,16 @@ class SamplingParams(TypedDict, total=False):
"""
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
- supported values are `minimal`, `low`, `medium`, and `high`. Reducing reasoning
- effort can result in faster responses and fewer tokens used on reasoning in a
- response.
-
- Note: The `gpt-5-pro` model defaults to (and only supports) `high` reasoning
- effort.
+ supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
+ reasoning effort can result in faster responses and fewer tokens used on
+ reasoning in a response.
+
+ - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
+ reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
+ calls are supported for all reasoning values in gpt-5.1.
+ - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
+ support `none`.
+ - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
"""
seed: Optional[int]
src/openai/types/responses/__init__.py
@@ -23,13 +23,16 @@ from .response_prompt import ResponsePrompt as ResponsePrompt
from .response_status import ResponseStatus as ResponseStatus
from .tool_choice_mcp import ToolChoiceMcp as ToolChoiceMcp
from .web_search_tool import WebSearchTool as WebSearchTool
+from .apply_patch_tool import ApplyPatchTool as ApplyPatchTool
from .file_search_tool import FileSearchTool as FileSearchTool
from .custom_tool_param import CustomToolParam as CustomToolParam
+from .tool_choice_shell import ToolChoiceShell as ToolChoiceShell
from .tool_choice_types import ToolChoiceTypes as ToolChoiceTypes
from .easy_input_message import EasyInputMessage as EasyInputMessage
from .response_item_list import ResponseItemList as ResponseItemList
from .tool_choice_custom import ToolChoiceCustom as ToolChoiceCustom
from .computer_tool_param import ComputerToolParam as ComputerToolParam
+from .function_shell_tool import FunctionShellTool as FunctionShellTool
from .function_tool_param import FunctionToolParam as FunctionToolParam
from .response_includable import ResponseIncludable as ResponseIncludable
from .response_input_file import ResponseInputFile as ResponseInputFile
@@ -51,6 +54,7 @@ from .response_queued_event import ResponseQueuedEvent as ResponseQueuedEvent
from .response_stream_event import ResponseStreamEvent as ResponseStreamEvent
from .tool_choice_mcp_param import ToolChoiceMcpParam as ToolChoiceMcpParam
from .web_search_tool_param import WebSearchToolParam as WebSearchToolParam
+from .apply_patch_tool_param import ApplyPatchToolParam as ApplyPatchToolParam
from .file_search_tool_param import FileSearchToolParam as FileSearchToolParam
from .input_item_list_params import InputItemListParams as InputItemListParams
from .response_create_params import ResponseCreateParams as ResponseCreateParams
@@ -59,6 +63,8 @@ from .response_input_content import ResponseInputContent as ResponseInputContent
from .response_output_message import ResponseOutputMessage as ResponseOutputMessage
from .response_output_refusal import ResponseOutputRefusal as ResponseOutputRefusal
from .response_reasoning_item import ResponseReasoningItem as ResponseReasoningItem
+from .tool_choice_apply_patch import ToolChoiceApplyPatch as ToolChoiceApplyPatch
+from .tool_choice_shell_param import ToolChoiceShellParam as ToolChoiceShellParam
from .tool_choice_types_param import ToolChoiceTypesParam as ToolChoiceTypesParam
from .web_search_preview_tool import WebSearchPreviewTool as WebSearchPreviewTool
from .easy_input_message_param import EasyInputMessageParam as EasyInputMessageParam
@@ -67,6 +73,7 @@ from .response_completed_event import ResponseCompletedEvent as ResponseComplete
from .response_retrieve_params import ResponseRetrieveParams as ResponseRetrieveParams
from .response_text_done_event import ResponseTextDoneEvent as ResponseTextDoneEvent
from .tool_choice_custom_param import ToolChoiceCustomParam as ToolChoiceCustomParam
+from .function_shell_tool_param import FunctionShellToolParam as FunctionShellToolParam
from .response_audio_done_event import ResponseAudioDoneEvent as ResponseAudioDoneEvent
from .response_custom_tool_call import ResponseCustomToolCall as ResponseCustomToolCall
from .response_incomplete_event import ResponseIncompleteEvent as ResponseIncompleteEvent
@@ -98,7 +105,9 @@ from .response_refusal_delta_event import ResponseRefusalDeltaEvent as ResponseR
from .response_output_message_param import ResponseOutputMessageParam as ResponseOutputMessageParam
from .response_output_refusal_param import ResponseOutputRefusalParam as ResponseOutputRefusalParam
from .response_reasoning_item_param import ResponseReasoningItemParam as ResponseReasoningItemParam
+from .tool_choice_apply_patch_param import ToolChoiceApplyPatchParam as ToolChoiceApplyPatchParam
from .web_search_preview_tool_param import WebSearchPreviewToolParam as WebSearchPreviewToolParam
+from .response_apply_patch_tool_call import ResponseApplyPatchToolCall as ResponseApplyPatchToolCall
from .response_file_search_tool_call import ResponseFileSearchToolCall as ResponseFileSearchToolCall
from .response_mcp_call_failed_event import ResponseMcpCallFailedEvent as ResponseMcpCallFailedEvent
from .response_custom_tool_call_param import ResponseCustomToolCallParam as ResponseCustomToolCallParam
@@ -110,6 +119,7 @@ from .response_output_item_added_event import ResponseOutputItemAddedEvent as Re
from .response_computer_tool_call_param import ResponseComputerToolCallParam as ResponseComputerToolCallParam
from .response_content_part_added_event import ResponseContentPartAddedEvent as ResponseContentPartAddedEvent
from .response_format_text_config_param import ResponseFormatTextConfigParam as ResponseFormatTextConfigParam
+from .response_function_shell_tool_call import ResponseFunctionShellToolCall as ResponseFunctionShellToolCall
from .response_function_tool_call_param import ResponseFunctionToolCallParam as ResponseFunctionToolCallParam
from .response_input_file_content_param import ResponseInputFileContentParam as ResponseInputFileContentParam
from .response_input_text_content_param import ResponseInputTextContentParam as ResponseInputTextContentParam
@@ -125,6 +135,7 @@ from .response_reasoning_text_delta_event import ResponseReasoningTextDeltaEvent
from .response_audio_transcript_done_event import ResponseAudioTranscriptDoneEvent as ResponseAudioTranscriptDoneEvent
from .response_file_search_tool_call_param import ResponseFileSearchToolCallParam as ResponseFileSearchToolCallParam
from .response_mcp_list_tools_failed_event import ResponseMcpListToolsFailedEvent as ResponseMcpListToolsFailedEvent
+from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput as ResponseApplyPatchToolCallOutput
from .response_audio_transcript_delta_event import (
ResponseAudioTranscriptDeltaEvent as ResponseAudioTranscriptDeltaEvent,
)
@@ -158,6 +169,9 @@ from .response_mcp_list_tools_completed_event import (
from .response_function_call_output_item_param import (
ResponseFunctionCallOutputItemParam as ResponseFunctionCallOutputItemParam,
)
+from .response_function_shell_tool_call_output import (
+ ResponseFunctionShellToolCallOutput as ResponseFunctionShellToolCallOutput,
+)
from .response_image_gen_call_generating_event import (
ResponseImageGenCallGeneratingEvent as ResponseImageGenCallGeneratingEvent,
)
@@ -206,6 +220,9 @@ from .response_file_search_call_in_progress_event import (
from .response_function_call_arguments_done_event import (
ResponseFunctionCallArgumentsDoneEvent as ResponseFunctionCallArgumentsDoneEvent,
)
+from .response_function_shell_call_output_content import (
+ ResponseFunctionShellCallOutputContent as ResponseFunctionShellCallOutputContent,
+)
from .response_image_gen_call_partial_image_event import (
ResponseImageGenCallPartialImageEvent as ResponseImageGenCallPartialImageEvent,
)
@@ -245,6 +262,9 @@ from .response_code_interpreter_call_in_progress_event import (
from .response_code_interpreter_call_interpreting_event import (
ResponseCodeInterpreterCallInterpretingEvent as ResponseCodeInterpreterCallInterpretingEvent,
)
+from .response_function_shell_call_output_content_param import (
+ ResponseFunctionShellCallOutputContentParam as ResponseFunctionShellCallOutputContentParam,
+)
from .response_computer_tool_call_output_screenshot_param import (
ResponseComputerToolCallOutputScreenshotParam as ResponseComputerToolCallOutputScreenshotParam,
)
src/openai/types/responses/apply_patch_tool.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ApplyPatchTool"]
+
+
+class ApplyPatchTool(BaseModel):
+ type: Literal["apply_patch"]
+ """The type of the tool. Always `apply_patch`."""
src/openai/types/responses/apply_patch_tool_param.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ApplyPatchToolParam"]
+
+
+class ApplyPatchToolParam(TypedDict, total=False):
+ type: Required[Literal["apply_patch"]]
+ """The type of the tool. Always `apply_patch`."""
src/openai/types/responses/function_shell_tool.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["FunctionShellTool"]
+
+
+class FunctionShellTool(BaseModel):
+ type: Literal["shell"]
+ """The type of the shell tool. Always `shell`."""
src/openai/types/responses/function_shell_tool_param.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["FunctionShellToolParam"]
+
+
+class FunctionShellToolParam(TypedDict, total=False):
+ type: Required[Literal["shell"]]
+ """The type of the shell tool. Always `shell`."""
src/openai/types/responses/input_token_count_params.py
@@ -8,6 +8,7 @@ from typing_extensions import Literal, TypeAlias, TypedDict
from .tool_param import ToolParam
from .tool_choice_options import ToolChoiceOptions
from .tool_choice_mcp_param import ToolChoiceMcpParam
+from .tool_choice_shell_param import ToolChoiceShellParam
from .tool_choice_types_param import ToolChoiceTypesParam
from ..shared_params.reasoning import Reasoning
from .tool_choice_custom_param import ToolChoiceCustomParam
@@ -15,6 +16,7 @@ from .response_input_item_param import ResponseInputItemParam
from .tool_choice_allowed_param import ToolChoiceAllowedParam
from .tool_choice_function_param import ToolChoiceFunctionParam
from .response_conversation_param import ResponseConversationParam
+from .tool_choice_apply_patch_param import ToolChoiceApplyPatchParam
from .response_format_text_config_param import ResponseFormatTextConfigParam
__all__ = ["InputTokenCountParams", "Conversation", "Text", "ToolChoice"]
@@ -135,4 +137,6 @@ ToolChoice: TypeAlias = Union[
ToolChoiceFunctionParam,
ToolChoiceMcpParam,
ToolChoiceCustomParam,
+ ToolChoiceApplyPatchParam,
+ ToolChoiceShellParam,
]
src/openai/types/responses/parsed_response.py
@@ -23,8 +23,12 @@ from .response_custom_tool_call import ResponseCustomToolCall
from .response_computer_tool_call import ResponseComputerToolCall
from .response_function_tool_call import ResponseFunctionToolCall
from .response_function_web_search import ResponseFunctionWebSearch
+from .response_apply_patch_tool_call import ResponseApplyPatchToolCall
from .response_file_search_tool_call import ResponseFileSearchToolCall
+from .response_function_shell_tool_call import ResponseFunctionShellToolCall
from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall
+from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput
+from .response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput
__all__ = ["ParsedResponse", "ParsedResponseOutputMessage", "ParsedResponseOutputText"]
@@ -75,6 +79,10 @@ ParsedResponseOutputItem: TypeAlias = Annotated[
McpListTools,
ResponseCodeInterpreterToolCall,
ResponseCustomToolCall,
+ ResponseFunctionShellToolCall,
+ ResponseFunctionShellToolCallOutput,
+ ResponseApplyPatchToolCall,
+ ResponseApplyPatchToolCallOutput,
],
PropertyInfo(discriminator="type"),
]
src/openai/types/responses/response.py
@@ -12,6 +12,7 @@ from .response_status import ResponseStatus
from .tool_choice_mcp import ToolChoiceMcp
from ..shared.metadata import Metadata
from ..shared.reasoning import Reasoning
+from .tool_choice_shell import ToolChoiceShell
from .tool_choice_types import ToolChoiceTypes
from .tool_choice_custom import ToolChoiceCustom
from .response_input_item import ResponseInputItem
@@ -21,6 +22,7 @@ from .response_output_item import ResponseOutputItem
from .response_text_config import ResponseTextConfig
from .tool_choice_function import ToolChoiceFunction
from ..shared.responses_model import ResponsesModel
+from .tool_choice_apply_patch import ToolChoiceApplyPatch
__all__ = ["Response", "IncompleteDetails", "ToolChoice", "Conversation"]
@@ -31,7 +33,14 @@ class IncompleteDetails(BaseModel):
ToolChoice: TypeAlias = Union[
- ToolChoiceOptions, ToolChoiceAllowed, ToolChoiceTypes, ToolChoiceFunction, ToolChoiceMcp, ToolChoiceCustom
+ ToolChoiceOptions,
+ ToolChoiceAllowed,
+ ToolChoiceTypes,
+ ToolChoiceFunction,
+ ToolChoiceMcp,
+ ToolChoiceCustom,
+ ToolChoiceApplyPatch,
+ ToolChoiceShell,
]
@@ -192,6 +201,14 @@ class Response(BaseModel):
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
"""
+ 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
+ active for longer, up to a maximum of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+ """
+
reasoning: Optional[Reasoning] = None
"""**gpt-5 and o-series models only**
src/openai/types/responses/response_apply_patch_tool_call.py
@@ -0,0 +1,76 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from ..._utils import PropertyInfo
+from ..._models import BaseModel
+
+__all__ = [
+ "ResponseApplyPatchToolCall",
+ "Operation",
+ "OperationCreateFile",
+ "OperationDeleteFile",
+ "OperationUpdateFile",
+]
+
+
+class OperationCreateFile(BaseModel):
+ diff: str
+ """Diff to apply."""
+
+ path: str
+ """Path of the file to create."""
+
+ type: Literal["create_file"]
+ """Create a new file with the provided diff."""
+
+
+class OperationDeleteFile(BaseModel):
+ path: str
+ """Path of the file to delete."""
+
+ type: Literal["delete_file"]
+ """Delete the specified file."""
+
+
+class OperationUpdateFile(BaseModel):
+ diff: str
+ """Diff to apply."""
+
+ path: str
+ """Path of the file to update."""
+
+ type: Literal["update_file"]
+ """Update an existing file with the provided diff."""
+
+
+Operation: TypeAlias = Annotated[
+ Union[OperationCreateFile, OperationDeleteFile, OperationUpdateFile], PropertyInfo(discriminator="type")
+]
+
+
+class ResponseApplyPatchToolCall(BaseModel):
+ id: str
+ """The unique ID of the apply patch tool call.
+
+ Populated when this item is returned via API.
+ """
+
+ call_id: str
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ status: Literal["in_progress", "completed"]
+ """The status of the apply patch tool call. One of `in_progress` or `completed`."""
+
+ type: Literal["apply_patch_call"]
+ """The type of the item. Always `apply_patch_call`."""
+
+ created_by: Optional[str] = None
+ """The ID of the entity that created this tool call."""
+
+ operation: Optional[Operation] = None
+ """
+ One of the create_file, delete_file, or update_file operations applied via
+ apply_patch.
+ """
src/openai/types/responses/response_apply_patch_tool_call_output.py
@@ -0,0 +1,31 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ResponseApplyPatchToolCallOutput"]
+
+
+class ResponseApplyPatchToolCallOutput(BaseModel):
+ id: str
+ """The unique ID of the apply patch tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ call_id: str
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ output: Optional[str] = None
+ """Optional textual output returned by the apply patch tool."""
+
+ status: Literal["completed", "failed"]
+ """The status of the apply patch tool call output. One of `completed` or `failed`."""
+
+ type: Literal["apply_patch_call_output"]
+ """The type of the item. Always `apply_patch_call_output`."""
+
+ created_by: Optional[str] = None
+ """The ID of the entity that created this tool call output."""
src/openai/types/responses/response_create_params.py
@@ -12,6 +12,7 @@ from .response_input_param import ResponseInputParam
from .response_prompt_param import ResponsePromptParam
from .tool_choice_mcp_param import ToolChoiceMcpParam
from ..shared_params.metadata import Metadata
+from .tool_choice_shell_param import ToolChoiceShellParam
from .tool_choice_types_param import ToolChoiceTypesParam
from ..shared_params.reasoning import Reasoning
from .tool_choice_custom_param import ToolChoiceCustomParam
@@ -19,6 +20,7 @@ from .tool_choice_allowed_param import ToolChoiceAllowedParam
from .response_text_config_param import ResponseTextConfigParam
from .tool_choice_function_param import ToolChoiceFunctionParam
from .response_conversation_param import ResponseConversationParam
+from .tool_choice_apply_patch_param import ToolChoiceApplyPatchParam
from ..shared_params.responses_model import ResponsesModel
__all__ = [
@@ -146,6 +148,14 @@ class ResponseCreateParamsBase(TypedDict, total=False):
[Learn more](https://platform.openai.com/docs/guides/prompt-caching).
"""
+ 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
+ active for longer, up to a maximum of 24 hours.
+ [Learn more](https://platform.openai.com/docs/guides/prompt-caching#prompt-cache-retention).
+ """
+
reasoning: Optional[Reasoning]
"""**gpt-5 and o-series models only**
@@ -292,6 +302,8 @@ ToolChoice: TypeAlias = Union[
ToolChoiceFunctionParam,
ToolChoiceMcpParam,
ToolChoiceCustomParam,
+ ToolChoiceApplyPatchParam,
+ ToolChoiceShellParam,
]
src/openai/types/responses/response_function_shell_call_output_content.py
@@ -0,0 +1,36 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Union
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from ..._utils import PropertyInfo
+from ..._models import BaseModel
+
+__all__ = ["ResponseFunctionShellCallOutputContent", "Outcome", "OutcomeTimeout", "OutcomeExit"]
+
+
+class OutcomeTimeout(BaseModel):
+ type: Literal["timeout"]
+ """The outcome type. Always `timeout`."""
+
+
+class OutcomeExit(BaseModel):
+ exit_code: int
+ """The exit code returned by the shell process."""
+
+ type: Literal["exit"]
+ """The outcome type. Always `exit`."""
+
+
+Outcome: TypeAlias = Annotated[Union[OutcomeTimeout, OutcomeExit], PropertyInfo(discriminator="type")]
+
+
+class ResponseFunctionShellCallOutputContent(BaseModel):
+ outcome: Outcome
+ """The exit or timeout outcome associated with this chunk."""
+
+ stderr: str
+ """Captured stderr output for this chunk of the shell call."""
+
+ stdout: str
+ """Captured stdout output for this chunk of the shell call."""
src/openai/types/responses/response_function_shell_call_output_content_param.py
@@ -0,0 +1,35 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Union
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
+
+__all__ = ["ResponseFunctionShellCallOutputContentParam", "Outcome", "OutcomeTimeout", "OutcomeExit"]
+
+
+class OutcomeTimeout(TypedDict, total=False):
+ type: Required[Literal["timeout"]]
+ """The outcome type. Always `timeout`."""
+
+
+class OutcomeExit(TypedDict, total=False):
+ exit_code: Required[int]
+ """The exit code returned by the shell process."""
+
+ type: Required[Literal["exit"]]
+ """The outcome type. Always `exit`."""
+
+
+Outcome: TypeAlias = Union[OutcomeTimeout, OutcomeExit]
+
+
+class ResponseFunctionShellCallOutputContentParam(TypedDict, total=False):
+ outcome: Required[Outcome]
+ """The exit or timeout outcome associated with this chunk."""
+
+ stderr: Required[str]
+ """Captured stderr output for this chunk of the shell call."""
+
+ stdout: Required[str]
+ """Captured stdout output for this chunk of the shell call."""
src/openai/types/responses/response_function_shell_tool_call.py
@@ -0,0 +1,44 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ResponseFunctionShellToolCall", "Action"]
+
+
+class Action(BaseModel):
+ commands: List[str]
+
+ max_output_length: Optional[int] = None
+ """Optional maximum number of characters to return from each command."""
+
+ timeout_ms: Optional[int] = None
+ """Optional timeout in milliseconds for the commands."""
+
+
+class ResponseFunctionShellToolCall(BaseModel):
+ id: str
+ """The unique ID of the function shell tool call.
+
+ Populated when this item is returned via API.
+ """
+
+ action: Action
+ """The shell commands and limits that describe how to run the tool call."""
+
+ call_id: str
+ """The unique ID of the function shell tool call generated by the model."""
+
+ status: Literal["in_progress", "completed", "incomplete"]
+ """The status of the shell call.
+
+ One of `in_progress`, `completed`, or `incomplete`.
+ """
+
+ type: Literal["shell_call"]
+ """The type of the item. Always `shell_call`."""
+
+ created_by: Optional[str] = None
+ """The ID of the entity that created this tool call."""
src/openai/types/responses/response_function_shell_tool_call_output.py
@@ -0,0 +1,70 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Union, Optional
+from typing_extensions import Literal, Annotated, TypeAlias
+
+from ..._utils import PropertyInfo
+from ..._models import BaseModel
+
+__all__ = [
+ "ResponseFunctionShellToolCallOutput",
+ "Output",
+ "OutputOutcome",
+ "OutputOutcomeTimeout",
+ "OutputOutcomeExit",
+]
+
+
+class OutputOutcomeTimeout(BaseModel):
+ type: Literal["timeout"]
+ """The outcome type. Always `timeout`."""
+
+
+class OutputOutcomeExit(BaseModel):
+ exit_code: int
+ """Exit code from the shell process."""
+
+ type: Literal["exit"]
+ """The outcome type. Always `exit`."""
+
+
+OutputOutcome: TypeAlias = Annotated[Union[OutputOutcomeTimeout, OutputOutcomeExit], PropertyInfo(discriminator="type")]
+
+
+class Output(BaseModel):
+ outcome: OutputOutcome
+ """
+ Represents either an exit outcome (with an exit code) or a timeout outcome for a
+ shell call output chunk.
+ """
+
+ stderr: str
+
+ stdout: str
+
+ created_by: Optional[str] = None
+
+
+class ResponseFunctionShellToolCallOutput(BaseModel):
+ id: str
+ """The unique ID of the shell call output.
+
+ Populated when this item is returned via API.
+ """
+
+ call_id: str
+ """The unique ID of the shell tool call generated by the model."""
+
+ max_output_length: Optional[int] = None
+ """The maximum length of the shell command output.
+
+ This is generated by the model and should be passed back with the raw output.
+ """
+
+ output: List[Output]
+ """An array of shell call output contents"""
+
+ type: Literal["shell_call_output"]
+ """The type of the shell call output. Always `shell_call_output`."""
+
+ created_by: Optional[str] = None
src/openai/types/responses/response_input_item.py
@@ -17,6 +17,7 @@ from .response_custom_tool_call_output import ResponseCustomToolCallOutput
from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall
from .response_input_message_content_list import ResponseInputMessageContentList
from .response_function_call_output_item_list import ResponseFunctionCallOutputItemList
+from .response_function_shell_call_output_content import ResponseFunctionShellCallOutputContent
from .response_computer_tool_call_output_screenshot import ResponseComputerToolCallOutputScreenshot
__all__ = [
@@ -29,6 +30,15 @@ __all__ = [
"LocalShellCall",
"LocalShellCallAction",
"LocalShellCallOutput",
+ "ShellCall",
+ "ShellCallAction",
+ "ShellCallOutput",
+ "ApplyPatchCall",
+ "ApplyPatchCallOperation",
+ "ApplyPatchCallOperationCreateFile",
+ "ApplyPatchCallOperationDeleteFile",
+ "ApplyPatchCallOperationUpdateFile",
+ "ApplyPatchCallOutput",
"McpListTools",
"McpListToolsTool",
"McpApprovalRequest",
@@ -186,6 +196,151 @@ class LocalShellCallOutput(BaseModel):
"""The status of the item. One of `in_progress`, `completed`, or `incomplete`."""
+class ShellCallAction(BaseModel):
+ commands: List[str]
+ """Ordered shell commands for the execution environment to run."""
+
+ max_output_length: Optional[int] = None
+ """
+ Maximum number of UTF-8 characters to capture from combined stdout and stderr
+ output.
+ """
+
+ timeout_ms: Optional[int] = None
+ """Maximum wall-clock time in milliseconds to allow the shell commands to run."""
+
+
+class ShellCall(BaseModel):
+ action: ShellCallAction
+ """The shell commands and limits that describe how to run the tool call."""
+
+ call_id: str
+ """The unique ID of the function shell tool call generated by the model."""
+
+ type: Literal["shell_call"]
+ """The type of the item. Always `function_shell_call`."""
+
+ id: Optional[str] = None
+ """The unique ID of the function shell tool call.
+
+ Populated when this item is returned via API.
+ """
+
+ status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
+ """The status of the shell call.
+
+ One of `in_progress`, `completed`, or `incomplete`.
+ """
+
+
+class ShellCallOutput(BaseModel):
+ call_id: str
+ """The unique ID of the function shell tool call generated by the model."""
+
+ output: List[ResponseFunctionShellCallOutputContent]
+ """
+ Captured chunks of stdout and stderr output, along with their associated
+ outcomes.
+ """
+
+ type: Literal["shell_call_output"]
+ """The type of the item. Always `function_shell_call_output`."""
+
+ id: Optional[str] = None
+ """The unique ID of the function shell tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ max_output_length: Optional[int] = None
+ """
+ The maximum number of UTF-8 characters captured for this shell call's combined
+ output.
+ """
+
+
+class ApplyPatchCallOperationCreateFile(BaseModel):
+ diff: str
+ """Unified diff content to apply when creating the file."""
+
+ path: str
+ """Path of the file to create relative to the workspace root."""
+
+ type: Literal["create_file"]
+ """The operation type. Always `create_file`."""
+
+
+class ApplyPatchCallOperationDeleteFile(BaseModel):
+ path: str
+ """Path of the file to delete relative to the workspace root."""
+
+ type: Literal["delete_file"]
+ """The operation type. Always `delete_file`."""
+
+
+class ApplyPatchCallOperationUpdateFile(BaseModel):
+ diff: str
+ """Unified diff content to apply to the existing file."""
+
+ path: str
+ """Path of the file to update relative to the workspace root."""
+
+ type: Literal["update_file"]
+ """The operation type. Always `update_file`."""
+
+
+ApplyPatchCallOperation: TypeAlias = Annotated[
+ Union[ApplyPatchCallOperationCreateFile, ApplyPatchCallOperationDeleteFile, ApplyPatchCallOperationUpdateFile],
+ PropertyInfo(discriminator="type"),
+]
+
+
+class ApplyPatchCall(BaseModel):
+ call_id: str
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ operation: ApplyPatchCallOperation
+ """
+ The specific create, delete, or update instruction for the apply_patch tool
+ call.
+ """
+
+ status: Literal["in_progress", "completed"]
+ """The status of the apply patch tool call. One of `in_progress` or `completed`."""
+
+ type: Literal["apply_patch_call"]
+ """The type of the item. Always `apply_patch_call`."""
+
+ id: Optional[str] = None
+ """The unique ID of the apply patch tool call.
+
+ Populated when this item is returned via API.
+ """
+
+
+class ApplyPatchCallOutput(BaseModel):
+ call_id: str
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ status: Literal["completed", "failed"]
+ """The status of the apply patch tool call output. One of `completed` or `failed`."""
+
+ type: Literal["apply_patch_call_output"]
+ """The type of the item. Always `apply_patch_call_output`."""
+
+ id: Optional[str] = None
+ """The unique ID of the apply patch tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ output: Optional[str] = None
+ """
+ Optional human-readable log text from the apply patch tool (e.g., patch results
+ or errors).
+ """
+
+
class McpListToolsTool(BaseModel):
input_schema: object
"""The JSON schema describing the tool's input."""
@@ -311,6 +466,10 @@ ResponseInputItem: TypeAlias = Annotated[
ResponseCodeInterpreterToolCall,
LocalShellCall,
LocalShellCallOutput,
+ ShellCall,
+ ShellCallOutput,
+ ApplyPatchCall,
+ ApplyPatchCallOutput,
McpListTools,
McpApprovalRequest,
McpApprovalResponse,
src/openai/types/responses/response_input_item_param.py
@@ -18,6 +18,7 @@ from .response_custom_tool_call_output_param import ResponseCustomToolCallOutput
from .response_code_interpreter_tool_call_param import ResponseCodeInterpreterToolCallParam
from .response_input_message_content_list_param import ResponseInputMessageContentListParam
from .response_function_call_output_item_list_param import ResponseFunctionCallOutputItemListParam
+from .response_function_shell_call_output_content_param import ResponseFunctionShellCallOutputContentParam
from .response_computer_tool_call_output_screenshot_param import ResponseComputerToolCallOutputScreenshotParam
__all__ = [
@@ -30,6 +31,15 @@ __all__ = [
"LocalShellCall",
"LocalShellCallAction",
"LocalShellCallOutput",
+ "ShellCall",
+ "ShellCallAction",
+ "ShellCallOutput",
+ "ApplyPatchCall",
+ "ApplyPatchCallOperation",
+ "ApplyPatchCallOperationCreateFile",
+ "ApplyPatchCallOperationDeleteFile",
+ "ApplyPatchCallOperationUpdateFile",
+ "ApplyPatchCallOutput",
"McpListTools",
"McpListToolsTool",
"McpApprovalRequest",
@@ -187,6 +197,150 @@ class LocalShellCallOutput(TypedDict, total=False):
"""The status of the item. One of `in_progress`, `completed`, or `incomplete`."""
+class ShellCallAction(TypedDict, total=False):
+ commands: Required[SequenceNotStr[str]]
+ """Ordered shell commands for the execution environment to run."""
+
+ max_output_length: Optional[int]
+ """
+ Maximum number of UTF-8 characters to capture from combined stdout and stderr
+ output.
+ """
+
+ timeout_ms: Optional[int]
+ """Maximum wall-clock time in milliseconds to allow the shell commands to run."""
+
+
+class ShellCall(TypedDict, total=False):
+ action: Required[ShellCallAction]
+ """The shell commands and limits that describe how to run the tool call."""
+
+ call_id: Required[str]
+ """The unique ID of the function shell tool call generated by the model."""
+
+ type: Required[Literal["shell_call"]]
+ """The type of the item. Always `function_shell_call`."""
+
+ id: Optional[str]
+ """The unique ID of the function shell tool call.
+
+ Populated when this item is returned via API.
+ """
+
+ status: Optional[Literal["in_progress", "completed", "incomplete"]]
+ """The status of the shell call.
+
+ One of `in_progress`, `completed`, or `incomplete`.
+ """
+
+
+class ShellCallOutput(TypedDict, total=False):
+ call_id: Required[str]
+ """The unique ID of the function shell tool call generated by the model."""
+
+ output: Required[Iterable[ResponseFunctionShellCallOutputContentParam]]
+ """
+ Captured chunks of stdout and stderr output, along with their associated
+ outcomes.
+ """
+
+ type: Required[Literal["shell_call_output"]]
+ """The type of the item. Always `function_shell_call_output`."""
+
+ id: Optional[str]
+ """The unique ID of the function shell tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ max_output_length: Optional[int]
+ """
+ The maximum number of UTF-8 characters captured for this shell call's combined
+ output.
+ """
+
+
+class ApplyPatchCallOperationCreateFile(TypedDict, total=False):
+ diff: Required[str]
+ """Unified diff content to apply when creating the file."""
+
+ path: Required[str]
+ """Path of the file to create relative to the workspace root."""
+
+ type: Required[Literal["create_file"]]
+ """The operation type. Always `create_file`."""
+
+
+class ApplyPatchCallOperationDeleteFile(TypedDict, total=False):
+ path: Required[str]
+ """Path of the file to delete relative to the workspace root."""
+
+ type: Required[Literal["delete_file"]]
+ """The operation type. Always `delete_file`."""
+
+
+class ApplyPatchCallOperationUpdateFile(TypedDict, total=False):
+ diff: Required[str]
+ """Unified diff content to apply to the existing file."""
+
+ path: Required[str]
+ """Path of the file to update relative to the workspace root."""
+
+ type: Required[Literal["update_file"]]
+ """The operation type. Always `update_file`."""
+
+
+ApplyPatchCallOperation: TypeAlias = Union[
+ ApplyPatchCallOperationCreateFile, ApplyPatchCallOperationDeleteFile, ApplyPatchCallOperationUpdateFile
+]
+
+
+class ApplyPatchCall(TypedDict, total=False):
+ call_id: Required[str]
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ operation: Required[ApplyPatchCallOperation]
+ """
+ The specific create, delete, or update instruction for the apply_patch tool
+ call.
+ """
+
+ status: Required[Literal["in_progress", "completed"]]
+ """The status of the apply patch tool call. One of `in_progress` or `completed`."""
+
+ type: Required[Literal["apply_patch_call"]]
+ """The type of the item. Always `apply_patch_call`."""
+
+ id: Optional[str]
+ """The unique ID of the apply patch tool call.
+
+ Populated when this item is returned via API.
+ """
+
+
+class ApplyPatchCallOutput(TypedDict, total=False):
+ call_id: Required[str]
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ status: Required[Literal["completed", "failed"]]
+ """The status of the apply patch tool call output. One of `completed` or `failed`."""
+
+ type: Required[Literal["apply_patch_call_output"]]
+ """The type of the item. Always `apply_patch_call_output`."""
+
+ id: Optional[str]
+ """The unique ID of the apply patch tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ output: str
+ """
+ Optional human-readable log text from the apply patch tool (e.g., patch results
+ or errors).
+ """
+
+
class McpListToolsTool(TypedDict, total=False):
input_schema: Required[object]
"""The JSON schema describing the tool's input."""
@@ -311,6 +465,10 @@ ResponseInputItemParam: TypeAlias = Union[
ResponseCodeInterpreterToolCallParam,
LocalShellCall,
LocalShellCallOutput,
+ ShellCall,
+ ShellCallOutput,
+ ApplyPatchCall,
+ ApplyPatchCallOutput,
McpListTools,
McpApprovalRequest,
McpApprovalResponse,
src/openai/types/responses/response_input_param.py
@@ -18,6 +18,7 @@ from .response_custom_tool_call_output_param import ResponseCustomToolCallOutput
from .response_code_interpreter_tool_call_param import ResponseCodeInterpreterToolCallParam
from .response_input_message_content_list_param import ResponseInputMessageContentListParam
from .response_function_call_output_item_list_param import ResponseFunctionCallOutputItemListParam
+from .response_function_shell_call_output_content_param import ResponseFunctionShellCallOutputContentParam
from .response_computer_tool_call_output_screenshot_param import ResponseComputerToolCallOutputScreenshotParam
__all__ = [
@@ -31,6 +32,15 @@ __all__ = [
"LocalShellCall",
"LocalShellCallAction",
"LocalShellCallOutput",
+ "ShellCall",
+ "ShellCallAction",
+ "ShellCallOutput",
+ "ApplyPatchCall",
+ "ApplyPatchCallOperation",
+ "ApplyPatchCallOperationCreateFile",
+ "ApplyPatchCallOperationDeleteFile",
+ "ApplyPatchCallOperationUpdateFile",
+ "ApplyPatchCallOutput",
"McpListTools",
"McpListToolsTool",
"McpApprovalRequest",
@@ -188,6 +198,150 @@ class LocalShellCallOutput(TypedDict, total=False):
"""The status of the item. One of `in_progress`, `completed`, or `incomplete`."""
+class ShellCallAction(TypedDict, total=False):
+ commands: Required[SequenceNotStr[str]]
+ """Ordered shell commands for the execution environment to run."""
+
+ max_output_length: Optional[int]
+ """
+ Maximum number of UTF-8 characters to capture from combined stdout and stderr
+ output.
+ """
+
+ timeout_ms: Optional[int]
+ """Maximum wall-clock time in milliseconds to allow the shell commands to run."""
+
+
+class ShellCall(TypedDict, total=False):
+ action: Required[ShellCallAction]
+ """The shell commands and limits that describe how to run the tool call."""
+
+ call_id: Required[str]
+ """The unique ID of the function shell tool call generated by the model."""
+
+ type: Required[Literal["shell_call"]]
+ """The type of the item. Always `function_shell_call`."""
+
+ id: Optional[str]
+ """The unique ID of the function shell tool call.
+
+ Populated when this item is returned via API.
+ """
+
+ status: Optional[Literal["in_progress", "completed", "incomplete"]]
+ """The status of the shell call.
+
+ One of `in_progress`, `completed`, or `incomplete`.
+ """
+
+
+class ShellCallOutput(TypedDict, total=False):
+ call_id: Required[str]
+ """The unique ID of the function shell tool call generated by the model."""
+
+ output: Required[Iterable[ResponseFunctionShellCallOutputContentParam]]
+ """
+ Captured chunks of stdout and stderr output, along with their associated
+ outcomes.
+ """
+
+ type: Required[Literal["shell_call_output"]]
+ """The type of the item. Always `function_shell_call_output`."""
+
+ id: Optional[str]
+ """The unique ID of the function shell tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ max_output_length: Optional[int]
+ """
+ The maximum number of UTF-8 characters captured for this shell call's combined
+ output.
+ """
+
+
+class ApplyPatchCallOperationCreateFile(TypedDict, total=False):
+ diff: Required[str]
+ """Unified diff content to apply when creating the file."""
+
+ path: Required[str]
+ """Path of the file to create relative to the workspace root."""
+
+ type: Required[Literal["create_file"]]
+ """The operation type. Always `create_file`."""
+
+
+class ApplyPatchCallOperationDeleteFile(TypedDict, total=False):
+ path: Required[str]
+ """Path of the file to delete relative to the workspace root."""
+
+ type: Required[Literal["delete_file"]]
+ """The operation type. Always `delete_file`."""
+
+
+class ApplyPatchCallOperationUpdateFile(TypedDict, total=False):
+ diff: Required[str]
+ """Unified diff content to apply to the existing file."""
+
+ path: Required[str]
+ """Path of the file to update relative to the workspace root."""
+
+ type: Required[Literal["update_file"]]
+ """The operation type. Always `update_file`."""
+
+
+ApplyPatchCallOperation: TypeAlias = Union[
+ ApplyPatchCallOperationCreateFile, ApplyPatchCallOperationDeleteFile, ApplyPatchCallOperationUpdateFile
+]
+
+
+class ApplyPatchCall(TypedDict, total=False):
+ call_id: Required[str]
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ operation: Required[ApplyPatchCallOperation]
+ """
+ The specific create, delete, or update instruction for the apply_patch tool
+ call.
+ """
+
+ status: Required[Literal["in_progress", "completed"]]
+ """The status of the apply patch tool call. One of `in_progress` or `completed`."""
+
+ type: Required[Literal["apply_patch_call"]]
+ """The type of the item. Always `apply_patch_call`."""
+
+ id: Optional[str]
+ """The unique ID of the apply patch tool call.
+
+ Populated when this item is returned via API.
+ """
+
+
+class ApplyPatchCallOutput(TypedDict, total=False):
+ call_id: Required[str]
+ """The unique ID of the apply patch tool call generated by the model."""
+
+ status: Required[Literal["completed", "failed"]]
+ """The status of the apply patch tool call output. One of `completed` or `failed`."""
+
+ type: Required[Literal["apply_patch_call_output"]]
+ """The type of the item. Always `apply_patch_call_output`."""
+
+ id: Optional[str]
+ """The unique ID of the apply patch tool call output.
+
+ Populated when this item is returned via API.
+ """
+
+ output: str
+ """
+ Optional human-readable log text from the apply patch tool (e.g., patch results
+ or errors).
+ """
+
+
class McpListToolsTool(TypedDict, total=False):
input_schema: Required[object]
"""The JSON schema describing the tool's input."""
@@ -312,6 +466,10 @@ ResponseInputItemParam: TypeAlias = Union[
ResponseCodeInterpreterToolCallParam,
LocalShellCall,
LocalShellCallOutput,
+ ShellCall,
+ ShellCallOutput,
+ ApplyPatchCall,
+ ApplyPatchCallOutput,
McpListTools,
McpApprovalRequest,
McpApprovalResponse,
src/openai/types/responses/response_item.py
@@ -9,11 +9,15 @@ from .response_output_message import ResponseOutputMessage
from .response_computer_tool_call import ResponseComputerToolCall
from .response_input_message_item import ResponseInputMessageItem
from .response_function_web_search import ResponseFunctionWebSearch
+from .response_apply_patch_tool_call import ResponseApplyPatchToolCall
from .response_file_search_tool_call import ResponseFileSearchToolCall
from .response_function_tool_call_item import ResponseFunctionToolCallItem
+from .response_function_shell_tool_call import ResponseFunctionShellToolCall
from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall
+from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput
from .response_computer_tool_call_output_item import ResponseComputerToolCallOutputItem
from .response_function_tool_call_output_item import ResponseFunctionToolCallOutputItem
+from .response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput
__all__ = [
"ResponseItem",
@@ -209,6 +213,10 @@ ResponseItem: TypeAlias = Annotated[
ResponseCodeInterpreterToolCall,
LocalShellCall,
LocalShellCallOutput,
+ ResponseFunctionShellToolCall,
+ ResponseFunctionShellToolCallOutput,
+ ResponseApplyPatchToolCall,
+ ResponseApplyPatchToolCallOutput,
McpListTools,
McpApprovalRequest,
McpApprovalResponse,
src/openai/types/responses/response_output_item.py
@@ -11,8 +11,12 @@ from .response_custom_tool_call import ResponseCustomToolCall
from .response_computer_tool_call import ResponseComputerToolCall
from .response_function_tool_call import ResponseFunctionToolCall
from .response_function_web_search import ResponseFunctionWebSearch
+from .response_apply_patch_tool_call import ResponseApplyPatchToolCall
from .response_file_search_tool_call import ResponseFileSearchToolCall
+from .response_function_shell_tool_call import ResponseFunctionShellToolCall
from .response_code_interpreter_tool_call import ResponseCodeInterpreterToolCall
+from .response_apply_patch_tool_call_output import ResponseApplyPatchToolCallOutput
+from .response_function_shell_tool_call_output import ResponseFunctionShellToolCallOutput
__all__ = [
"ResponseOutputItem",
@@ -172,6 +176,10 @@ ResponseOutputItem: TypeAlias = Annotated[
ImageGenerationCall,
ResponseCodeInterpreterToolCall,
LocalShellCall,
+ ResponseFunctionShellToolCall,
+ ResponseFunctionShellToolCallOutput,
+ ResponseApplyPatchToolCall,
+ ResponseApplyPatchToolCallOutput,
McpCall,
McpListTools,
McpApprovalRequest,
src/openai/types/responses/tool.py
@@ -10,7 +10,9 @@ from .custom_tool import CustomTool
from .computer_tool import ComputerTool
from .function_tool import FunctionTool
from .web_search_tool import WebSearchTool
+from .apply_patch_tool import ApplyPatchTool
from .file_search_tool import FileSearchTool
+from .function_shell_tool import FunctionShellTool
from .web_search_preview_tool import WebSearchPreviewTool
__all__ = [
@@ -260,8 +262,10 @@ Tool: TypeAlias = Annotated[
CodeInterpreter,
ImageGeneration,
LocalShell,
+ FunctionShellTool,
CustomTool,
WebSearchPreviewTool,
+ ApplyPatchTool,
],
PropertyInfo(discriminator="type"),
]
src/openai/types/responses/tool_choice_apply_patch.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ToolChoiceApplyPatch"]
+
+
+class ToolChoiceApplyPatch(BaseModel):
+ type: Literal["apply_patch"]
+ """The tool to call. Always `apply_patch`."""
src/openai/types/responses/tool_choice_apply_patch_param.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ToolChoiceApplyPatchParam"]
+
+
+class ToolChoiceApplyPatchParam(TypedDict, total=False):
+ type: Required[Literal["apply_patch"]]
+ """The tool to call. Always `apply_patch`."""
src/openai/types/responses/tool_choice_shell.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["ToolChoiceShell"]
+
+
+class ToolChoiceShell(BaseModel):
+ type: Literal["shell"]
+ """The tool to call. Always `shell`."""
src/openai/types/responses/tool_choice_shell_param.py
@@ -0,0 +1,12 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ToolChoiceShellParam"]
+
+
+class ToolChoiceShellParam(TypedDict, total=False):
+ type: Required[Literal["shell"]]
+ """The tool to call. Always `shell`."""
src/openai/types/responses/tool_param.py
@@ -12,7 +12,9 @@ from .custom_tool_param import CustomToolParam
from .computer_tool_param import ComputerToolParam
from .function_tool_param import FunctionToolParam
from .web_search_tool_param import WebSearchToolParam
+from .apply_patch_tool_param import ApplyPatchToolParam
from .file_search_tool_param import FileSearchToolParam
+from .function_shell_tool_param import FunctionShellToolParam
from .web_search_preview_tool_param import WebSearchPreviewToolParam
__all__ = [
@@ -259,8 +261,10 @@ ToolParam: TypeAlias = Union[
CodeInterpreter,
ImageGeneration,
LocalShell,
+ FunctionShellToolParam,
CustomToolParam,
WebSearchPreviewToolParam,
+ ApplyPatchToolParam,
]
src/openai/types/batch_create_params.py
@@ -17,13 +17,15 @@ class BatchCreateParams(TypedDict, total=False):
Currently only `24h` is supported.
"""
- endpoint: Required[Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions"]]
+ endpoint: Required[
+ Literal["/v1/responses", "/v1/chat/completions", "/v1/embeddings", "/v1/completions", "/v1/moderations"]
+ ]
"""The endpoint to be used for all requests in the batch.
- Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and
- `/v1/completions` are supported. Note that `/v1/embeddings` batches are also
- restricted to a maximum of 50,000 embedding inputs across all requests in the
- batch.
+ Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`,
+ `/v1/completions`, and `/v1/moderations` are supported. Note that
+ `/v1/embeddings` batches are also restricted to a maximum of 50,000 embedding
+ inputs across all requests in the batch.
"""
input_file_id: Required[str]
tests/api_resources/beta/threads/test_runs.py
@@ -59,7 +59,7 @@ class TestRuns:
metadata={"foo": "string"},
model="string",
parallel_tool_calls=True,
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
stream=False,
temperature=1,
@@ -150,7 +150,7 @@ class TestRuns:
metadata={"foo": "string"},
model="string",
parallel_tool_calls=True,
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
temperature=1,
tool_choice="none",
@@ -609,7 +609,7 @@ class TestAsyncRuns:
metadata={"foo": "string"},
model="string",
parallel_tool_calls=True,
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
stream=False,
temperature=1,
@@ -700,7 +700,7 @@ class TestAsyncRuns:
metadata={"foo": "string"},
model="string",
parallel_tool_calls=True,
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
temperature=1,
tool_choice="none",
tests/api_resources/beta/test_assistants.py
@@ -36,7 +36,7 @@ class TestAssistants:
instructions="instructions",
metadata={"foo": "string"},
name="name",
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
temperature=1,
tool_resources={
@@ -135,7 +135,7 @@ class TestAssistants:
metadata={"foo": "string"},
model="string",
name="name",
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
temperature=1,
tool_resources={
@@ -272,7 +272,7 @@ class TestAsyncAssistants:
instructions="instructions",
metadata={"foo": "string"},
name="name",
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
temperature=1,
tool_resources={
@@ -371,7 +371,7 @@ class TestAsyncAssistants:
metadata={"foo": "string"},
model="string",
name="name",
- reasoning_effort="minimal",
+ reasoning_effort="none",
response_format="auto",
temperature=1,
tool_resources={
tests/api_resources/chat/test_completions.py
@@ -73,7 +73,8 @@ class TestCompletions:
},
presence_penalty=-2,
prompt_cache_key="prompt-cache-key-1234",
- reasoning_effort="minimal",
+ prompt_cache_retention="in-memory",
+ reasoning_effort="none",
response_format={"type": "text"},
safety_identifier="safety-identifier-1234",
seed=-9007199254740991,
@@ -206,7 +207,8 @@ class TestCompletions:
},
presence_penalty=-2,
prompt_cache_key="prompt-cache-key-1234",
- reasoning_effort="minimal",
+ prompt_cache_retention="in-memory",
+ reasoning_effort="none",
response_format={"type": "text"},
safety_identifier="safety-identifier-1234",
seed=-9007199254740991,
@@ -514,7 +516,8 @@ class TestAsyncCompletions:
},
presence_penalty=-2,
prompt_cache_key="prompt-cache-key-1234",
- reasoning_effort="minimal",
+ prompt_cache_retention="in-memory",
+ reasoning_effort="none",
response_format={"type": "text"},
safety_identifier="safety-identifier-1234",
seed=-9007199254740991,
@@ -647,7 +650,8 @@ class TestAsyncCompletions:
},
presence_penalty=-2,
prompt_cache_key="prompt-cache-key-1234",
- reasoning_effort="minimal",
+ prompt_cache_retention="in-memory",
+ reasoning_effort="none",
response_format={"type": "text"},
safety_identifier="safety-identifier-1234",
seed=-9007199254740991,
tests/api_resources/responses/test_input_tokens.py
@@ -32,7 +32,7 @@ class TestInputTokens:
parallel_tool_calls=True,
previous_response_id="resp_123",
reasoning={
- "effort": "minimal",
+ "effort": "none",
"generate_summary": "auto",
"summary": "auto",
},
@@ -95,7 +95,7 @@ class TestAsyncInputTokens:
parallel_tool_calls=True,
previous_response_id="resp_123",
reasoning={
- "effort": "minimal",
+ "effort": "none",
"generate_summary": "auto",
"summary": "auto",
},
tests/api_resources/test_responses.py
@@ -45,8 +45,9 @@ class TestResponses:
"version": "version",
},
prompt_cache_key="prompt-cache-key-1234",
+ prompt_cache_retention="in-memory",
reasoning={
- "effort": "minimal",
+ "effort": "none",
"generate_summary": "auto",
"summary": "auto",
},
@@ -125,8 +126,9 @@ class TestResponses:
"version": "version",
},
prompt_cache_key="prompt-cache-key-1234",
+ prompt_cache_retention="in-memory",
reasoning={
- "effort": "minimal",
+ "effort": "none",
"generate_summary": "auto",
"summary": "auto",
},
@@ -398,8 +400,9 @@ class TestAsyncResponses:
"version": "version",
},
prompt_cache_key="prompt-cache-key-1234",
+ prompt_cache_retention="in-memory",
reasoning={
- "effort": "minimal",
+ "effort": "none",
"generate_summary": "auto",
"summary": "auto",
},
@@ -478,8 +481,9 @@ class TestAsyncResponses:
"version": "version",
},
prompt_cache_key="prompt-cache-key-1234",
+ prompt_cache_retention="in-memory",
reasoning={
- "effort": "minimal",
+ "effort": "none",
"generate_summary": "auto",
"summary": "auto",
},
.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 136
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-eeba8addf3a5f412e5ce8d22031e60c61650cee3f5d9e587a2533f6818a249ea.yml
-openapi_spec_hash: 0a4d8ad2469823ce24a3fd94f23f1c2b
-config_hash: 630eea84bb3067d25640419af058ed56
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ca24bc4d8125b5153514ce643c4e3220f25971b7d67ca384d56d493c72c0d977.yml
+openapi_spec_hash: c6f048c7b3d29f4de48fde0e845ba33f
+config_hash: b876221dfb213df9f0a999e75d38a65e
api.md
@@ -732,12 +732,16 @@ Types:
```python
from openai.types.responses import (
+ ApplyPatchTool,
ComputerTool,
CustomTool,
EasyInputMessage,
FileSearchTool,
+ FunctionShellTool,
FunctionTool,
Response,
+ ResponseApplyPatchToolCall,
+ ResponseApplyPatchToolCallOutput,
ResponseAudioDeltaEvent,
ResponseAudioDoneEvent,
ResponseAudioTranscriptDeltaEvent,
@@ -774,6 +778,9 @@ from openai.types.responses import (
ResponseFunctionCallArgumentsDoneEvent,
ResponseFunctionCallOutputItem,
ResponseFunctionCallOutputItemList,
+ ResponseFunctionShellCallOutputContent,
+ ResponseFunctionShellToolCall,
+ ResponseFunctionShellToolCallOutput,
ResponseFunctionToolCall,
ResponseFunctionToolCallItem,
ResponseFunctionToolCallOutputItem,
@@ -836,10 +843,12 @@ from openai.types.responses import (
ResponseWebSearchCallSearchingEvent,
Tool,
ToolChoiceAllowed,
+ ToolChoiceApplyPatch,
ToolChoiceCustom,
ToolChoiceFunction,
ToolChoiceMcp,
ToolChoiceOptions,
+ ToolChoiceShell,
ToolChoiceTypes,
WebSearchPreviewTool,
WebSearchTool,