diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5868289349..cff01f26f0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.14.0" + ".": "2.15.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e9485c8224..fe01e150f9 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-75926226b642ebb2cb415694da9dff35e8ab40145ac1b791cefb82a83809db4d.yml -openapi_spec_hash: 6a0e391b0ba5747b6b4a3e5fe21de4da -config_hash: adcf23ecf5f84d3cadf1d71e82ec636a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-9442fa9212dd61aac2bb0edd19744bee381e75888712f9098bc6ebb92c52b557.yml +openapi_spec_hash: f87823d164b7a8f72a42eba04e482a99 +config_hash: ad7136f7366fddec432ec378939e58a7 diff --git a/CHANGELOG.md b/CHANGELOG.md index ca71bc108e..4630e50610 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 2.15.0 (2026-01-09) + +Full Changelog: [v2.14.0...v2.15.0](https://github.com/openai/openai-python/compare/v2.14.0...v2.15.0) + +### Features + +* **api:** add new Response completed_at prop ([f077752](https://github.com/openai/openai-python/commit/f077752f4a8364a74f784f8fb1cbe31277e1762b)) + + +### Chores + +* **internal:** codegen related update ([e7daba6](https://github.com/openai/openai-python/commit/e7daba6662a3c30f73d991e96cb19d2b54d772e0)) + ## 2.14.0 (2025-12-19) Full Changelog: [v2.13.0...v2.14.0](https://github.com/openai/openai-python/compare/v2.13.0...v2.14.0) diff --git a/LICENSE b/LICENSE index f011417af6..cbb5bb26e4 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 OpenAI + Copyright 2026 OpenAI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pyproject.toml b/pyproject.toml index a720293abb..2d835b05af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.14.0" +version = "2.15.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 5fe6b5b08c..6f0ccf7d72 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.14.0" # x-release-please-version +__version__ = "2.15.0" # x-release-please-version diff --git a/src/openai/resources/audio/speech.py b/src/openai/resources/audio/speech.py index b92fcb73d3..f2c8d635f3 100644 --- a/src/openai/resources/audio/speech.py +++ b/src/openai/resources/audio/speech.py @@ -74,9 +74,10 @@ def create( One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. - voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and - `verse`. Previews of the voices are available in the + voice: The voice to use when generating the audio. Supported built-in voices are + `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available + in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). instructions: Control the voice of your generated audio with additional instructions. Does not @@ -170,9 +171,10 @@ async def create( One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`. - voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`, - `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and - `verse`. Previews of the voices are available in the + voice: The voice to use when generating the audio. Supported built-in voices are + `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Previews of the voices are available + in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). instructions: Control the voice of your generated audio with additional instructions. Does not diff --git a/src/openai/resources/images.py b/src/openai/resources/images.py index 79505a8269..805828488f 100644 --- a/src/openai/resources/images.py +++ b/src/openai/resources/images.py @@ -146,7 +146,8 @@ def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint only supports `gpt-image-1` and `dall-e-2`. + This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, + and `gpt-image-1-mini`) and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. @@ -260,7 +261,8 @@ def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint only supports `gpt-image-1` and `dall-e-2`. + This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, + and `gpt-image-1-mini`) and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. @@ -374,7 +376,8 @@ def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint only supports `gpt-image-1` and `dall-e-2`. + This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, + and `gpt-image-1-mini`) and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. @@ -1039,7 +1042,8 @@ async def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint only supports `gpt-image-1` and `dall-e-2`. + This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, + and `gpt-image-1-mini`) and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. @@ -1153,7 +1157,8 @@ async def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint only supports `gpt-image-1` and `dall-e-2`. + This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, + and `gpt-image-1-mini`) and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. @@ -1267,7 +1272,8 @@ async def edit( """Creates an edited or extended image given one or more source images and a prompt. - This endpoint only supports `gpt-image-1` and `dall-e-2`. + This endpoint supports GPT Image models (`gpt-image-1.5`, `gpt-image-1`, + and `gpt-image-1-mini`) and `dall-e-2`. Args: image: The image(s) to edit. Must be a supported image file or an array of images. diff --git a/src/openai/resources/responses/input_tokens.py b/src/openai/resources/responses/input_tokens.py index 0f47955fe4..8664164655 100644 --- a/src/openai/resources/responses/input_tokens.py +++ b/src/openai/resources/responses/input_tokens.py @@ -102,9 +102,7 @@ def count( - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - tool_choice: How the model should select which tool (or tools) to use when generating a - response. See the `tools` parameter to see how to specify which tools the model - can call. + tool_choice: Controls which tool the model should use, if any. tools: An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. @@ -227,9 +225,7 @@ async def count( - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - tool_choice: How the model should select which tool (or tools) to use when generating a - response. See the `tools` parameter to see how to specify which tools the model - can call. + tool_choice: Controls which tool the model should use, if any. tools: An array of tools the model may call while generating a response. You can specify which tool to use by setting the `tool_choice` parameter. diff --git a/src/openai/types/audio/speech_create_params.py b/src/openai/types/audio/speech_create_params.py index 37180995c8..417df5b218 100644 --- a/src/openai/types/audio/speech_create_params.py +++ b/src/openai/types/audio/speech_create_params.py @@ -25,9 +25,9 @@ class SpeechCreateParams(TypedDict, total=False): ] """The voice to use when generating the audio. - Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, - `nova`, `sage`, `shimmer`, and `verse`. Previews of the voices are available in - the + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, + `fable`, `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. + Previews of the voices are available in the [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). """ diff --git a/src/openai/types/chat/chat_completion_audio_param.py b/src/openai/types/chat/chat_completion_audio_param.py index cac3c8b9d4..1a73bb0c7e 100644 --- a/src/openai/types/chat/chat_completion_audio_param.py +++ b/src/openai/types/chat/chat_completion_audio_param.py @@ -26,6 +26,6 @@ class ChatCompletionAudioParam(TypedDict, total=False): ] """The voice the model uses to respond. - Supported voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, - `onyx`, `sage`, and `shimmer`. + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, + `fable`, `nova`, `onyx`, `sage`, `shimmer`, `marin`, and `cedar`. """ diff --git a/src/openai/types/realtime/realtime_audio_config_output.py b/src/openai/types/realtime/realtime_audio_config_output.py index a8af237c1d..2922405f63 100644 --- a/src/openai/types/realtime/realtime_audio_config_output.py +++ b/src/openai/types/realtime/realtime_audio_config_output.py @@ -29,8 +29,8 @@ class RealtimeAudioConfigOutput(BaseModel): ] = None """The voice the model uses to respond. - Voice cannot be changed during the session once the model has responded with - audio at least once. Current voice options are `alloy`, `ash`, `ballad`, - `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. We recommend + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the + session once the model has responded with audio at least once. We recommend `marin` and `cedar` for best quality. """ diff --git a/src/openai/types/realtime/realtime_audio_config_output_param.py b/src/openai/types/realtime/realtime_audio_config_output_param.py index 8e887d3464..d04fd3a303 100644 --- a/src/openai/types/realtime/realtime_audio_config_output_param.py +++ b/src/openai/types/realtime/realtime_audio_config_output_param.py @@ -28,8 +28,8 @@ class RealtimeAudioConfigOutputParam(TypedDict, total=False): voice: Union[str, Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", "cedar"]] """The voice the model uses to respond. - Voice cannot be changed during the session once the model has responded with - audio at least once. Current voice options are `alloy`, `ash`, `ballad`, - `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. We recommend + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the + session once the model has responded with audio at least once. We recommend `marin` and `cedar` for best quality. """ diff --git a/src/openai/types/realtime/realtime_response_create_audio_output.py b/src/openai/types/realtime/realtime_response_create_audio_output.py index b8f4d284d5..db02511ab1 100644 --- a/src/openai/types/realtime/realtime_response_create_audio_output.py +++ b/src/openai/types/realtime/realtime_response_create_audio_output.py @@ -18,10 +18,9 @@ class Output(BaseModel): ] = None """The voice the model uses to respond. - Voice cannot be changed during the session once the model has responded with - audio at least once. Current voice options are `alloy`, `ash`, `ballad`, - `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. We recommend - `marin` and `cedar` for best quality. + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the + session once the model has responded with audio at least once. """ diff --git a/src/openai/types/realtime/realtime_response_create_audio_output_param.py b/src/openai/types/realtime/realtime_response_create_audio_output_param.py index 30a4633698..22787ad106 100644 --- a/src/openai/types/realtime/realtime_response_create_audio_output_param.py +++ b/src/openai/types/realtime/realtime_response_create_audio_output_param.py @@ -17,10 +17,9 @@ class Output(TypedDict, total=False): voice: Union[str, Literal["alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", "verse", "marin", "cedar"]] """The voice the model uses to respond. - Voice cannot be changed during the session once the model has responded with - audio at least once. Current voice options are `alloy`, `ash`, `ballad`, - `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. We recommend - `marin` and `cedar` for best quality. + Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the + session once the model has responded with audio at least once. """ diff --git a/src/openai/types/responses/input_token_count_params.py b/src/openai/types/responses/input_token_count_params.py index 50cc950e41..97ee4bf6ca 100644 --- a/src/openai/types/responses/input_token_count_params.py +++ b/src/openai/types/responses/input_token_count_params.py @@ -78,11 +78,7 @@ class InputTokenCountParams(TypedDict, total=False): """ tool_choice: Optional[ToolChoice] - """ - How the model should select which tool (or tools) to use when generating a - response. See the `tools` parameter to see how to specify which tools the model - can call. - """ + """Controls which tool the model should use, if any.""" tools: Optional[Iterable[ToolParam]] """An array of tools the model may call while generating a response. diff --git a/src/openai/types/responses/response.py b/src/openai/types/responses/response.py index 00c38c064e..6bac7d65de 100644 --- a/src/openai/types/responses/response.py +++ b/src/openai/types/responses/response.py @@ -47,13 +47,13 @@ class IncompleteDetails(BaseModel): class Conversation(BaseModel): - """The conversation that this response belongs to. + """The conversation that this response belonged to. - Input items and output items from this response are automatically added to this conversation. + Input items and output items from this response were automatically added to this conversation. """ id: str - """The unique ID of the conversation.""" + """The unique ID of the conversation that this response was associated with.""" class Response(BaseModel): @@ -165,10 +165,16 @@ class Response(BaseModel): [Learn more](https://platform.openai.com/docs/guides/background). """ + completed_at: Optional[float] = None + """ + Unix timestamp (in seconds) of when this Response was completed. Only present + when the status is `completed`. + """ + conversation: Optional[Conversation] = None - """The conversation that this response belongs to. + """The conversation that this response belonged to. - Input items and output items from this response are automatically added to this + Input items and output items from this response were automatically added to this conversation. """ diff --git a/src/openai/types/responses/response_compaction_item.py b/src/openai/types/responses/response_compaction_item.py index f5f8b97f4e..36e953b127 100644 --- a/src/openai/types/responses/response_compaction_item.py +++ b/src/openai/types/responses/response_compaction_item.py @@ -17,8 +17,10 @@ class ResponseCompactionItem(BaseModel): """The unique ID of the compaction item.""" encrypted_content: str + """The encrypted content that was produced by compaction.""" type: Literal["compaction"] """The type of the item. Always `compaction`.""" created_by: Optional[str] = None + """The identifier of the actor that created the item.""" diff --git a/src/openai/types/responses/response_compaction_item_param.py b/src/openai/types/responses/response_compaction_item_param.py index 5dcc921d67..5ef134b074 100644 --- a/src/openai/types/responses/response_compaction_item_param.py +++ b/src/openai/types/responses/response_compaction_item_param.py @@ -14,6 +14,7 @@ class ResponseCompactionItemParam(BaseModel): """ encrypted_content: str + """The encrypted content of the compaction summary.""" type: Literal["compaction"] """The type of the item. Always `compaction`.""" diff --git a/src/openai/types/responses/response_compaction_item_param_param.py b/src/openai/types/responses/response_compaction_item_param_param.py index b9b5ab031c..b4d72c2e5f 100644 --- a/src/openai/types/responses/response_compaction_item_param_param.py +++ b/src/openai/types/responses/response_compaction_item_param_param.py @@ -14,6 +14,7 @@ class ResponseCompactionItemParamParam(TypedDict, total=False): """ encrypted_content: Required[str] + """The encrypted content of the compaction summary.""" type: Required[Literal["compaction"]] """The type of the item. Always `compaction`.""" diff --git a/src/openai/types/responses/response_function_shell_tool_call_output.py b/src/openai/types/responses/response_function_shell_tool_call_output.py index 7885ee2f83..5523d57ba7 100644 --- a/src/openai/types/responses/response_function_shell_tool_call_output.py +++ b/src/openai/types/responses/response_function_shell_tool_call_output.py @@ -36,7 +36,7 @@ class OutputOutcomeExit(BaseModel): class Output(BaseModel): - """The content of a shell call output.""" + """The content of a shell tool call output that was emitted.""" outcome: OutputOutcome """ @@ -45,14 +45,17 @@ class Output(BaseModel): """ stderr: str + """The standard error output that was captured.""" stdout: str + """The standard output that was captured.""" created_by: Optional[str] = None + """The identifier of the actor that created the item.""" class ResponseFunctionShellToolCallOutput(BaseModel): - """The output of a shell tool call.""" + """The output of a shell tool call that was emitted.""" id: str """The unique ID of the shell call output. @@ -76,3 +79,4 @@ class ResponseFunctionShellToolCallOutput(BaseModel): """The type of the shell call output. Always `shell_call_output`.""" created_by: Optional[str] = None + """The identifier of the actor that created the item.""" diff --git a/src/openai/types/responses/response_function_web_search.py b/src/openai/types/responses/response_function_web_search.py index 1450fba4d1..0cb7e0b0d1 100644 --- a/src/openai/types/responses/response_function_web_search.py +++ b/src/openai/types/responses/response_function_web_search.py @@ -23,11 +23,14 @@ class ActionSearch(BaseModel): """Action type "search" - Performs a web search query.""" query: str - """The search query.""" + """[DEPRECATED] The search query.""" type: Literal["search"] """The action type.""" + queries: Optional[List[str]] = None + """The search queries.""" + sources: Optional[List[ActionSearchSource]] = None """The sources used in the search.""" diff --git a/src/openai/types/responses/response_function_web_search_param.py b/src/openai/types/responses/response_function_web_search_param.py index 8d0b60334d..7db3e3c833 100644 --- a/src/openai/types/responses/response_function_web_search_param.py +++ b/src/openai/types/responses/response_function_web_search_param.py @@ -5,6 +5,8 @@ from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict +from ..._types import SequenceNotStr + __all__ = [ "ResponseFunctionWebSearchParam", "Action", @@ -29,11 +31,14 @@ class ActionSearch(TypedDict, total=False): """Action type "search" - Performs a web search query.""" query: Required[str] - """The search query.""" + """[DEPRECATED] The search query.""" type: Required[Literal["search"]] """The action type.""" + queries: SequenceNotStr[str] + """The search queries.""" + sources: Iterable[ActionSearchSource] """The sources used in the search.""" diff --git a/src/openai/types/responses/tool.py b/src/openai/types/responses/tool.py index 20f50e4478..019962a0ba 100644 --- a/src/openai/types/responses/tool.py +++ b/src/openai/types/responses/tool.py @@ -187,6 +187,7 @@ class CodeInterpreterContainerCodeInterpreterToolAuto(BaseModel): """An optional list of uploaded files to make available to your code.""" memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]] = None + """The memory limit for the code interpreter container.""" CodeInterpreterContainer: TypeAlias = Union[str, CodeInterpreterContainerCodeInterpreterToolAuto] diff --git a/src/openai/types/responses/tool_param.py b/src/openai/types/responses/tool_param.py index 69c6162153..37d3dde024 100644 --- a/src/openai/types/responses/tool_param.py +++ b/src/openai/types/responses/tool_param.py @@ -187,6 +187,7 @@ class CodeInterpreterContainerCodeInterpreterToolAuto(TypedDict, total=False): """An optional list of uploaded files to make available to your code.""" memory_limit: Optional[Literal["1g", "4g", "16g", "64g"]] + """The memory limit for the code interpreter container.""" CodeInterpreterContainer: TypeAlias = Union[str, CodeInterpreterContainerCodeInterpreterToolAuto] diff --git a/src/openai/types/video_create_error.py b/src/openai/types/video_create_error.py index ae328b78ea..7f520220c8 100644 --- a/src/openai/types/video_create_error.py +++ b/src/openai/types/video_create_error.py @@ -6,6 +6,10 @@ class VideoCreateError(BaseModel): + """An error that occurred while generating the response.""" + code: str + """A machine-readable error code that was returned.""" message: str + """A human-readable description of the error that was returned."""