diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 21f60560ae..e6c39adb99 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.10.0" + ".": "2.11.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0aa25fb4a4..4e5b38902d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 137 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-88d85ff87ad8983262af2b729762a6e05fd509468bb691529bc2f81e4ce27c69.yml -openapi_spec_hash: 46a55acbccd0147534017b92c1f4dd99 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-41f98da99f44ebe6204fce5c1dc9940f85f3472779e797b674c4fdc20306c77d.yml +openapi_spec_hash: c61259027f421f501bdc6b23cf9e430e config_hash: 141b101c9f13b90e21af74e1686f1f41 diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a092665e..ff0878433f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.11.0 (2025-12-11) + +Full Changelog: [v2.10.0...v2.11.0](https://github.com/openai/openai-python/compare/v2.10.0...v2.11.0) + +### Features + +* **api:** gpt 5.2 ([dd9b8e8](https://github.com/openai/openai-python/commit/dd9b8e85cf91fe0d7470143fba10fe950ec740c4)) + ## 2.10.0 (2025-12-10) Full Changelog: [v2.9.0...v2.10.0](https://github.com/openai/openai-python/compare/v2.9.0...v2.10.0) diff --git a/pyproject.toml b/pyproject.toml index e7d181d007..f4e5bdb208 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.10.0" +version = "2.11.0" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_version.py b/src/openai/_version.py index c7a4f08f04..16036c3b6a 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "2.10.0" # x-release-please-version +__version__ = "2.11.0" # x-release-please-version diff --git a/src/openai/resources/beta/assistants.py b/src/openai/resources/beta/assistants.py index aa1f9f9b48..ab0947abf4 100644 --- a/src/openai/resources/beta/assistants.py +++ b/src/openai/resources/beta/assistants.py @@ -108,7 +108,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -323,7 +323,7 @@ def update( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -577,7 +577,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -792,7 +792,7 @@ async def update( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), diff --git a/src/openai/resources/beta/threads/runs/runs.py b/src/openai/resources/beta/threads/runs/runs.py index 9b6cb3f752..8a58e91f69 100644 --- a/src/openai/resources/beta/threads/runs/runs.py +++ b/src/openai/resources/beta/threads/runs/runs.py @@ -179,7 +179,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -341,7 +341,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -499,7 +499,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -1633,7 +1633,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -1795,7 +1795,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), @@ -1953,7 +1953,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), diff --git a/src/openai/resources/chat/completions/completions.py b/src/openai/resources/chat/completions/completions.py index 3f2732a608..9c0b74b804 100644 --- a/src/openai/resources/chat/completions/completions.py +++ b/src/openai/resources/chat/completions/completions.py @@ -421,7 +421,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: An object specifying the format that the model must output. @@ -732,7 +732,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: An object specifying the format that the model must output. @@ -1034,7 +1034,7 @@ def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: An object specifying the format that the model must output. @@ -1907,7 +1907,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: An object specifying the format that the model must output. @@ -2218,7 +2218,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: An object specifying the format that the model must output. @@ -2520,7 +2520,7 @@ async def create( - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. response_format: An object specifying the format that the model must output. diff --git a/src/openai/resources/responses/responses.py b/src/openai/resources/responses/responses.py index 81e8980faf..8e80f6793b 100644 --- a/src/openai/resources/responses/responses.py +++ b/src/openai/resources/responses/responses.py @@ -1528,6 +1528,11 @@ def compact( *, model: Union[ Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", "gpt-5.1", "gpt-5.1-2025-11-13", "gpt-5.1-codex", @@ -3141,6 +3146,11 @@ async def compact( *, model: Union[ Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", "gpt-5.1", "gpt-5.1-2025-11-13", "gpt-5.1-codex", diff --git a/src/openai/types/beta/assistant_create_params.py b/src/openai/types/beta/assistant_create_params.py index 49e7af2d67..461d871ab5 100644 --- a/src/openai/types/beta/assistant_create_params.py +++ b/src/openai/types/beta/assistant_create_params.py @@ -72,7 +72,7 @@ class AssistantCreateParams(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ response_format: Optional[AssistantResponseFormatOptionParam] diff --git a/src/openai/types/beta/assistant_update_params.py b/src/openai/types/beta/assistant_update_params.py index d84b15cc5b..7896fcd9c6 100644 --- a/src/openai/types/beta/assistant_update_params.py +++ b/src/openai/types/beta/assistant_update_params.py @@ -107,7 +107,7 @@ class AssistantUpdateParams(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ response_format: Optional[AssistantResponseFormatOptionParam] diff --git a/src/openai/types/beta/threads/run_create_params.py b/src/openai/types/beta/threads/run_create_params.py index f4c56feb56..376afc9aad 100644 --- a/src/openai/types/beta/threads/run_create_params.py +++ b/src/openai/types/beta/threads/run_create_params.py @@ -121,7 +121,7 @@ class RunCreateParamsBase(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ response_format: Optional[AssistantResponseFormatOptionParam] diff --git a/src/openai/types/chat/completion_create_params.py b/src/openai/types/chat/completion_create_params.py index 613787e9b5..49cefb95fc 100644 --- a/src/openai/types/chat/completion_create_params.py +++ b/src/openai/types/chat/completion_create_params.py @@ -207,7 +207,7 @@ class CompletionCreateParamsBase(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ response_format: ResponseFormat diff --git a/src/openai/types/evals/create_eval_completions_run_data_source.py b/src/openai/types/evals/create_eval_completions_run_data_source.py index 6ec39873b7..cc88450276 100644 --- a/src/openai/types/evals/create_eval_completions_run_data_source.py +++ b/src/openai/types/evals/create_eval_completions_run_data_source.py @@ -196,7 +196,7 @@ class SamplingParams(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ response_format: Optional[SamplingParamsResponseFormat] = None diff --git a/src/openai/types/evals/create_eval_completions_run_data_source_param.py b/src/openai/types/evals/create_eval_completions_run_data_source_param.py index 22d07c5598..bab2658afe 100644 --- a/src/openai/types/evals/create_eval_completions_run_data_source_param.py +++ b/src/openai/types/evals/create_eval_completions_run_data_source_param.py @@ -192,7 +192,7 @@ class SamplingParams(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ response_format: SamplingParamsResponseFormat diff --git a/src/openai/types/evals/run_cancel_response.py b/src/openai/types/evals/run_cancel_response.py index 40f071c959..6ad874b2b3 100644 --- a/src/openai/types/evals/run_cancel_response.py +++ b/src/openai/types/evals/run_cancel_response.py @@ -115,7 +115,7 @@ class DataSourceResponsesSourceResponses(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ temperature: Optional[float] = None @@ -278,7 +278,7 @@ class DataSourceResponsesSamplingParams(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: Optional[int] = None diff --git a/src/openai/types/evals/run_create_params.py b/src/openai/types/evals/run_create_params.py index 993e10c738..fd7d56e39d 100644 --- a/src/openai/types/evals/run_create_params.py +++ b/src/openai/types/evals/run_create_params.py @@ -128,7 +128,7 @@ class DataSourceCreateEvalResponsesRunDataSourceSourceResponses(TypedDict, total - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ temperature: Optional[float] @@ -296,7 +296,7 @@ class DataSourceCreateEvalResponsesRunDataSourceSamplingParams(TypedDict, total= - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: int diff --git a/src/openai/types/evals/run_create_response.py b/src/openai/types/evals/run_create_response.py index 93dae7adde..1651cb5b2f 100644 --- a/src/openai/types/evals/run_create_response.py +++ b/src/openai/types/evals/run_create_response.py @@ -115,7 +115,7 @@ class DataSourceResponsesSourceResponses(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ temperature: Optional[float] = None @@ -278,7 +278,7 @@ class DataSourceResponsesSamplingParams(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: Optional[int] = None diff --git a/src/openai/types/evals/run_list_response.py b/src/openai/types/evals/run_list_response.py index c3c745b21c..9ec84330cf 100644 --- a/src/openai/types/evals/run_list_response.py +++ b/src/openai/types/evals/run_list_response.py @@ -115,7 +115,7 @@ class DataSourceResponsesSourceResponses(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ temperature: Optional[float] = None @@ -278,7 +278,7 @@ class DataSourceResponsesSamplingParams(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: Optional[int] = None diff --git a/src/openai/types/evals/run_retrieve_response.py b/src/openai/types/evals/run_retrieve_response.py index d02256c679..9204635d1e 100644 --- a/src/openai/types/evals/run_retrieve_response.py +++ b/src/openai/types/evals/run_retrieve_response.py @@ -115,7 +115,7 @@ class DataSourceResponsesSourceResponses(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ temperature: Optional[float] = None @@ -278,7 +278,7 @@ class DataSourceResponsesSamplingParams(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: Optional[int] = None diff --git a/src/openai/types/graders/score_model_grader.py b/src/openai/types/graders/score_model_grader.py index 6dd5a0eee8..bceb8b1ad0 100644 --- a/src/openai/types/graders/score_model_grader.py +++ b/src/openai/types/graders/score_model_grader.py @@ -91,7 +91,7 @@ class SamplingParams(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: Optional[int] = None @@ -108,7 +108,11 @@ class ScoreModelGrader(BaseModel): """A ScoreModelGrader object that uses a model to assign a score to the input.""" input: List[Input] - """The input text. This may include template strings.""" + """The input messages evaluated by the grader. + + Supports text, output text, input image, and input audio content blocks, and may + include template strings. + """ model: str """The model to use for the evaluation.""" diff --git a/src/openai/types/graders/score_model_grader_param.py b/src/openai/types/graders/score_model_grader_param.py index 33452e43f3..bd08645a85 100644 --- a/src/openai/types/graders/score_model_grader_param.py +++ b/src/openai/types/graders/score_model_grader_param.py @@ -97,7 +97,7 @@ class SamplingParams(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ seed: Optional[int] @@ -114,7 +114,11 @@ class ScoreModelGraderParam(TypedDict, total=False): """A ScoreModelGrader object that uses a model to assign a score to the input.""" input: Required[Iterable[Input]] - """The input text. This may include template strings.""" + """The input messages evaluated by the grader. + + Supports text, output text, input image, and input audio content blocks, and may + include template strings. + """ model: Required[str] """The model to use for the evaluation.""" diff --git a/src/openai/types/responses/response_compact_params.py b/src/openai/types/responses/response_compact_params.py index 35a390f807..657c6a0764 100644 --- a/src/openai/types/responses/response_compact_params.py +++ b/src/openai/types/responses/response_compact_params.py @@ -14,6 +14,11 @@ class ResponseCompactParams(TypedDict, total=False): model: Required[ Union[ Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", "gpt-5.1", "gpt-5.1-2025-11-13", "gpt-5.1-codex", diff --git a/src/openai/types/shared/chat_model.py b/src/openai/types/shared/chat_model.py index b3ae7c3a95..8223b81bef 100644 --- a/src/openai/types/shared/chat_model.py +++ b/src/openai/types/shared/chat_model.py @@ -5,6 +5,11 @@ __all__ = ["ChatModel"] ChatModel: TypeAlias = Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", "gpt-5.1", "gpt-5.1-2025-11-13", "gpt-5.1-codex", diff --git a/src/openai/types/shared/reasoning.py b/src/openai/types/shared/reasoning.py index 1220a045b1..14f56a04cd 100644 --- a/src/openai/types/shared/reasoning.py +++ b/src/openai/types/shared/reasoning.py @@ -30,7 +30,7 @@ class Reasoning(BaseModel): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ generate_summary: Optional[Literal["auto", "concise", "detailed"]] = None @@ -47,5 +47,6 @@ class Reasoning(BaseModel): This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. - `concise` is only supported for `computer-use-preview` models. + `concise` is supported for `computer-use-preview` models and all reasoning + models after `gpt-5`. """ diff --git a/src/openai/types/shared_params/chat_model.py b/src/openai/types/shared_params/chat_model.py index 7505d51d67..c1937a8312 100644 --- a/src/openai/types/shared_params/chat_model.py +++ b/src/openai/types/shared_params/chat_model.py @@ -7,6 +7,11 @@ __all__ = ["ChatModel"] ChatModel: TypeAlias = Literal[ + "gpt-5.2", + "gpt-5.2-2025-12-11", + "gpt-5.2-chat-latest", + "gpt-5.2-pro", + "gpt-5.2-pro-2025-12-11", "gpt-5.1", "gpt-5.1-2025-11-13", "gpt-5.1-codex", diff --git a/src/openai/types/shared_params/reasoning.py b/src/openai/types/shared_params/reasoning.py index 68d9c374b8..2bd7ce7268 100644 --- a/src/openai/types/shared_params/reasoning.py +++ b/src/openai/types/shared_params/reasoning.py @@ -31,7 +31,7 @@ class Reasoning(TypedDict, total=False): - 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. - - `xhigh` is currently only supported for `gpt-5.1-codex-max`. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. """ generate_summary: Optional[Literal["auto", "concise", "detailed"]] @@ -48,5 +48,6 @@ class Reasoning(TypedDict, total=False): This can be useful for debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. - `concise` is only supported for `computer-use-preview` models. + `concise` is supported for `computer-use-preview` models and all reasoning + models after `gpt-5`. """ diff --git a/tests/api_resources/test_responses.py b/tests/api_resources/test_responses.py index d330eed134..3cdbdba8a6 100644 --- a/tests/api_resources/test_responses.py +++ b/tests/api_resources/test_responses.py @@ -362,14 +362,14 @@ def test_path_params_cancel(self, client: OpenAI) -> None: @parametrize def test_method_compact(self, client: OpenAI) -> None: response = client.responses.compact( - model="gpt-5.1", + model="gpt-5.2", ) assert_matches_type(CompactedResponse, response, path=["response"]) @parametrize def test_method_compact_with_all_params(self, client: OpenAI) -> None: response = client.responses.compact( - model="gpt-5.1", + model="gpt-5.2", input="string", instructions="instructions", previous_response_id="resp_123", @@ -379,7 +379,7 @@ def test_method_compact_with_all_params(self, client: OpenAI) -> None: @parametrize def test_raw_response_compact(self, client: OpenAI) -> None: http_response = client.responses.with_raw_response.compact( - model="gpt-5.1", + model="gpt-5.2", ) assert http_response.is_closed is True @@ -390,7 +390,7 @@ def test_raw_response_compact(self, client: OpenAI) -> None: @parametrize def test_streaming_response_compact(self, client: OpenAI) -> None: with client.responses.with_streaming_response.compact( - model="gpt-5.1", + model="gpt-5.2", ) as http_response: assert not http_response.is_closed assert http_response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -758,14 +758,14 @@ async def test_path_params_cancel(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_method_compact(self, async_client: AsyncOpenAI) -> None: response = await async_client.responses.compact( - model="gpt-5.1", + model="gpt-5.2", ) assert_matches_type(CompactedResponse, response, path=["response"]) @parametrize async def test_method_compact_with_all_params(self, async_client: AsyncOpenAI) -> None: response = await async_client.responses.compact( - model="gpt-5.1", + model="gpt-5.2", input="string", instructions="instructions", previous_response_id="resp_123", @@ -775,7 +775,7 @@ async def test_method_compact_with_all_params(self, async_client: AsyncOpenAI) - @parametrize async def test_raw_response_compact(self, async_client: AsyncOpenAI) -> None: http_response = await async_client.responses.with_raw_response.compact( - model="gpt-5.1", + model="gpt-5.2", ) assert http_response.is_closed is True @@ -786,7 +786,7 @@ async def test_raw_response_compact(self, async_client: AsyncOpenAI) -> None: @parametrize async def test_streaming_response_compact(self, async_client: AsyncOpenAI) -> None: async with async_client.responses.with_streaming_response.compact( - model="gpt-5.1", + model="gpt-5.2", ) as http_response: assert not http_response.is_closed assert http_response.http_request.headers.get("X-Stainless-Lang") == "python"