diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 841dcc60c0..11ee7212d7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.49.0" + ".": "2.50.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 61025cba01..f0a6394000 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 278 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-0650ebae454b4200491980d7663cb7ceabcff90dcb3ed9f67c3bca3e861a2bf6.yml -openapi_spec_hash: e9576bced964246b7e685a5ad30afffa -config_hash: 43e311595bcc4fb6b32eba0684de48d8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai/openai-9152683f2fa71f5555cbbb53123ec013b7c83ee6fed4333e76c22a6f48a05f1c.yml +openapi_spec_hash: c58a8c1bb1f5bb7245323db9437bd67f +config_hash: ca12d10f1dbe101a81cd0376f868c674 diff --git a/CHANGELOG.md b/CHANGELOG.md index 83be61f6ba..906170359d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 2.50.0 (2026-07-28) + +Full Changelog: [v2.49.0...v2.50.0](https://github.com/openai/openai-python/compare/v2.49.0...v2.50.0) + +### Features + +* **api:** transcription model updates ([fd57393](https://github.com/openai/openai-python/commit/fd57393389eac75af08c2e887cb188590448be20)) + + +### Bug Fixes + +* **audio:** restore transcription keyword overload ([713a262](https://github.com/openai/openai-python/commit/713a2624966c40f4e5b0c20436b8a79aa8383b08)) + ## 2.49.0 (2026-07-27) Full Changelog: [v2.48.0...v2.49.0](https://github.com/openai/openai-python/compare/v2.48.0...v2.49.0) diff --git a/api.md b/api.md index 0124bff7d0..7217cf566a 100644 --- a/api.md +++ b/api.md @@ -175,6 +175,7 @@ from openai.types.audio import ( TranscriptionDiarized, TranscriptionDiarizedSegment, TranscriptionInclude, + TranscriptionLanguage, TranscriptionSegment, TranscriptionStreamEvent, TranscriptionTextDeltaEvent, diff --git a/pyproject.toml b/pyproject.toml index 250cbb1a94..4cc151efcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "2.49.0" +version = "2.50.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 9ac2ab689f..8836067b9e 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.49.0" # x-release-please-version +__version__ = "2.50.0" # x-release-please-version diff --git a/src/openai/resources/audio/transcriptions.py b/src/openai/resources/audio/transcriptions.py index ab2480ef11..0ef903dc4b 100644 --- a/src/openai/resources/audio/transcriptions.py +++ b/src/openai/resources/audio/transcriptions.py @@ -72,7 +72,9 @@ def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[Literal["json"], Omit] = omit, stream: Optional[Literal[False]] | Omit = omit, @@ -96,7 +98,7 @@ def create( The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - model: ID of the model to use. The options are `gpt-4o-transcribe`, + model: ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. @@ -113,10 +115,15 @@ def create( `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. + language: The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + languages: Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + prompt: An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) @@ -160,8 +167,10 @@ def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, response_format: Literal["verbose_json"], language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, temperature: float | Omit = omit, timestamp_granularities: List[Literal["word", "segment"]] | Omit = omit, @@ -182,7 +191,9 @@ def create( chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, response_format: Literal["text", "srt", "vtt"], include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, temperature: float | Omit = omit, timestamp_granularities: List[Literal["word", "segment"]] | Omit = omit, @@ -202,9 +213,11 @@ def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, response_format: Literal["diarized_json"], + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, temperature: float | Omit = omit, timestamp_granularities: List[Literal["word", "segment"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -224,9 +237,11 @@ def create( stream: Literal[True], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[AudioResponseFormat, Omit] = omit, temperature: float | Omit = omit, @@ -249,7 +264,7 @@ def create( The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - model: ID of the model to use. The options are `gpt-4o-transcribe`, + model: ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. @@ -277,6 +292,9 @@ def create( `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. + keywords: Words or phrases to guide transcription of the input audio. Supported by + `gpt-transcribe`. + known_speaker_names: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. @@ -291,6 +309,10 @@ def create( [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + languages: Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + prompt: An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) @@ -335,9 +357,11 @@ def create( stream: bool, chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[AudioResponseFormat, Omit] = omit, temperature: float | Omit = omit, @@ -360,7 +384,7 @@ def create( The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - model: ID of the model to use. The options are `gpt-4o-transcribe`, + model: ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. @@ -388,6 +412,9 @@ def create( `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. + keywords: Words or phrases to guide transcription of the input audio. Supported by + `gpt-transcribe`. + known_speaker_names: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. @@ -402,6 +429,10 @@ def create( [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + languages: Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + prompt: An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) @@ -445,9 +476,11 @@ def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[AudioResponseFormat, Omit] = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, @@ -466,9 +499,11 @@ def create( "model": model, "chunking_strategy": chunking_strategy, "include": include, + "keywords": keywords, "known_speaker_names": known_speaker_names, "known_speaker_references": known_speaker_references, "language": language, + "languages": languages, "prompt": prompt, "response_format": response_format, "stream": stream, @@ -534,9 +569,11 @@ async def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[Literal["json"], Omit] = omit, stream: Optional[Literal[False]] | Omit = omit, @@ -560,7 +597,7 @@ async def create( The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - model: ID of the model to use. The options are `gpt-4o-transcribe`, + model: ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. @@ -579,6 +616,9 @@ async def create( `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. + keywords: Words or phrases to guide transcription of the input audio. Supported by + `gpt-transcribe`. + known_speaker_names: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. @@ -593,6 +633,10 @@ async def create( [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + languages: Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + prompt: An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) @@ -640,8 +684,10 @@ async def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, response_format: Literal["verbose_json"], language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, temperature: float | Omit = omit, timestamp_granularities: List[Literal["word", "segment"]] | Omit = omit, @@ -662,7 +708,9 @@ async def create( chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, response_format: Literal["text", "srt", "vtt"], + keywords: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, temperature: float | Omit = omit, timestamp_granularities: List[Literal["word", "segment"]] | Omit = omit, @@ -683,9 +731,11 @@ async def create( stream: Literal[True], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[AudioResponseFormat, Omit] = omit, temperature: float | Omit = omit, @@ -708,7 +758,7 @@ async def create( The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - model: ID of the model to use. The options are `gpt-4o-transcribe`, + model: ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. @@ -736,6 +786,9 @@ async def create( `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. + keywords: Words or phrases to guide transcription of the input audio. Supported by + `gpt-transcribe`. + known_speaker_names: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. @@ -750,6 +803,10 @@ async def create( [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + languages: Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + prompt: An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) @@ -794,9 +851,11 @@ async def create( stream: bool, chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[AudioResponseFormat, Omit] = omit, temperature: float | Omit = omit, @@ -819,7 +878,7 @@ async def create( The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - model: ID of the model to use. The options are `gpt-4o-transcribe`, + model: ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. @@ -847,6 +906,9 @@ async def create( `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`. + keywords: Words or phrases to guide transcription of the input audio. Supported by + `gpt-transcribe`. + known_speaker_names: Optional list of speaker names that correspond to the audio samples provided in `known_speaker_references[]`. Each entry should be a short identifier (for example `customer` or `agent`). Up to 4 speakers are supported. @@ -861,6 +923,10 @@ async def create( [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + languages: Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + prompt: An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) @@ -904,9 +970,11 @@ async def create( model: Union[str, AudioModel], chunking_strategy: Optional[transcription_create_params.ChunkingStrategy] | Omit = omit, include: List[TranscriptionInclude] | Omit = omit, + keywords: SequenceNotStr[str] | Omit = omit, known_speaker_names: SequenceNotStr[str] | Omit = omit, known_speaker_references: SequenceNotStr[str] | Omit = omit, language: str | Omit = omit, + languages: SequenceNotStr[str] | Omit = omit, prompt: str | Omit = omit, response_format: Union[AudioResponseFormat, Omit] = omit, stream: Optional[Literal[False]] | Literal[True] | Omit = omit, @@ -925,9 +993,11 @@ async def create( "model": model, "chunking_strategy": chunking_strategy, "include": include, + "keywords": keywords, "known_speaker_names": known_speaker_names, "known_speaker_references": known_speaker_references, "language": language, + "languages": languages, "prompt": prompt, "response_format": response_format, "stream": stream, diff --git a/src/openai/resources/webhooks/api.md b/src/openai/resources/webhooks/api.md index 8e3c312eb0..9203eb2efb 100644 --- a/src/openai/resources/webhooks/api.md +++ b/src/openai/resources/webhooks/api.md @@ -14,6 +14,7 @@ from openai.types.webhooks import ( FineTuningJobCancelledWebhookEvent, FineTuningJobFailedWebhookEvent, FineTuningJobSucceededWebhookEvent, + LiveCallIncomingWebhookEvent, RealtimeCallIncomingWebhookEvent, ResponseCancelledWebhookEvent, ResponseCompletedWebhookEvent, diff --git a/src/openai/types/audio/__init__.py b/src/openai/types/audio/__init__.py index 2ff2b8185d..66a7b7be86 100644 --- a/src/openai/types/audio/__init__.py +++ b/src/openai/types/audio/__init__.py @@ -12,6 +12,7 @@ from .transcription_segment import TranscriptionSegment as TranscriptionSegment from .transcription_verbose import TranscriptionVerbose as TranscriptionVerbose from .transcription_diarized import TranscriptionDiarized as TranscriptionDiarized +from .transcription_language import TranscriptionLanguage as TranscriptionLanguage from .translation_create_params import TranslationCreateParams as TranslationCreateParams from .transcription_stream_event import TranscriptionStreamEvent as TranscriptionStreamEvent from .transcription_create_params import TranscriptionCreateParams as TranscriptionCreateParams diff --git a/src/openai/types/audio/transcription.py b/src/openai/types/audio/transcription.py index cbae8bf750..787a2fecf3 100644 --- a/src/openai/types/audio/transcription.py +++ b/src/openai/types/audio/transcription.py @@ -5,6 +5,7 @@ from ..._utils import PropertyInfo from ..._models import BaseModel +from .transcription_language import TranscriptionLanguage __all__ = ["Transcription", "Logprob", "Usage", "UsageTokens", "UsageTokensInputTokenDetails", "UsageDuration"] @@ -70,6 +71,13 @@ class Transcription(BaseModel): text: str """The transcribed text.""" + languages: Optional[List[TranscriptionLanguage]] = None + """The languages detected in the audio. + + Returned by `gpt-transcribe`. An empty array indicates that no language could be + reliably detected. + """ + logprobs: Optional[List[Logprob]] = None """The log probabilities of the tokens in the transcription. diff --git a/src/openai/types/audio/transcription_create_params.py b/src/openai/types/audio/transcription_create_params.py index 15540fc73f..7ecba2d367 100644 --- a/src/openai/types/audio/transcription_create_params.py +++ b/src/openai/types/audio/transcription_create_params.py @@ -29,7 +29,7 @@ class TranscriptionCreateParamsBase(TypedDict, total=False): model: Required[Union[str, AudioModel]] """ID of the model to use. - The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, + The options are `gpt-transcribe`, `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1` (which is powered by our open source Whisper V2 model), and `gpt-4o-transcribe-diarize`. """ @@ -54,6 +54,12 @@ class TranscriptionCreateParamsBase(TypedDict, total=False): not supported when using `gpt-4o-transcribe-diarize`. """ + keywords: SequenceNotStr[str] + """Words or phrases to guide transcription of the input audio. + + Supported by `gpt-transcribe`. + """ + known_speaker_names: SequenceNotStr[str] """ Optional list of speaker names that correspond to the audio samples provided in @@ -78,6 +84,13 @@ class TranscriptionCreateParamsBase(TypedDict, total=False): format will improve accuracy and latency. """ + languages: SequenceNotStr[str] + """ + Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe`. + """ + prompt: str """An optional text to guide the model's style or continue a previous audio segment. diff --git a/src/openai/types/audio/transcription_language.py b/src/openai/types/audio/transcription_language.py new file mode 100644 index 0000000000..0cc9221b4a --- /dev/null +++ b/src/openai/types/audio/transcription_language.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["TranscriptionLanguage"] + + +class TranscriptionLanguage(BaseModel): + """A language detected in transcribed audio.""" + + code: str + """The code of a language detected in the audio.""" diff --git a/src/openai/types/audio/transcription_text_done_event.py b/src/openai/types/audio/transcription_text_done_event.py index c8f7fc0769..266995253e 100644 --- a/src/openai/types/audio/transcription_text_done_event.py +++ b/src/openai/types/audio/transcription_text_done_event.py @@ -4,6 +4,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from .transcription_language import TranscriptionLanguage __all__ = ["TranscriptionTextDoneEvent", "Logprob", "Usage", "UsageInputTokenDetails"] @@ -60,6 +61,13 @@ class TranscriptionTextDoneEvent(BaseModel): type: Literal["transcript.text.done"] """The type of the event. Always `transcript.text.done`.""" + languages: Optional[List[TranscriptionLanguage]] = None + """The languages detected in the audio. + + Returned by `gpt-transcribe`. An empty array indicates that no language could be + reliably detected. + """ + logprobs: Optional[List[Logprob]] = None """The log probabilities of the individual tokens in the transcription. diff --git a/src/openai/types/audio_model.py b/src/openai/types/audio_model.py index 8acada6dc3..075190557b 100644 --- a/src/openai/types/audio_model.py +++ b/src/openai/types/audio_model.py @@ -6,6 +6,7 @@ AudioModel: TypeAlias = Literal[ "whisper-1", + "gpt-transcribe", "gpt-4o-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-mini-transcribe-2025-12-15", diff --git a/src/openai/types/realtime/audio_transcription.py b/src/openai/types/realtime/audio_transcription.py index 45e2e388ca..1c1eca9b87 100644 --- a/src/openai/types/realtime/audio_transcription.py +++ b/src/openai/types/realtime/audio_transcription.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import List, Union, Optional from typing_extensions import Literal from ..._models import BaseModel @@ -16,6 +16,12 @@ class AudioTranscription(BaseModel): with `gpt-realtime-whisper` in GA Realtime sessions. """ + keywords: Optional[List[str]] = None + """Words or phrases to guide transcription of the input audio. + + Supported by `gpt-transcribe` and `gpt-live-transcribe`. + """ + language: Optional[str] = None """The language of the input audio. @@ -24,10 +30,19 @@ class AudioTranscription(BaseModel): format will improve accuracy and latency. """ + languages: Optional[List[str]] = None + """ + Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe` and `gpt-live-transcribe`. + """ + model: Union[ str, Literal[ "whisper-1", + "gpt-transcribe", + "gpt-live-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-mini-transcribe-2025-12-15", "gpt-4o-transcribe", @@ -38,10 +53,10 @@ class AudioTranscription(BaseModel): ] = None """The model to use for transcription. - Current options are `whisper-1`, `gpt-4o-mini-transcribe`, - `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, - `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use - `gpt-4o-transcribe-diarize` when you need diarization with speaker labels. + Current options are `whisper-1`, `gpt-transcribe`, `gpt-live-transcribe`, + `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, + `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. + Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels. """ prompt: Optional[str] = None diff --git a/src/openai/types/realtime/audio_transcription_param.py b/src/openai/types/realtime/audio_transcription_param.py index 9206921542..269f7ca4b2 100644 --- a/src/openai/types/realtime/audio_transcription_param.py +++ b/src/openai/types/realtime/audio_transcription_param.py @@ -5,6 +5,8 @@ from typing import Union from typing_extensions import Literal, TypedDict +from ..._types import SequenceNotStr + __all__ = ["AudioTranscriptionParam"] @@ -16,6 +18,12 @@ class AudioTranscriptionParam(TypedDict, total=False): with `gpt-realtime-whisper` in GA Realtime sessions. """ + keywords: SequenceNotStr[str] + """Words or phrases to guide transcription of the input audio. + + Supported by `gpt-transcribe` and `gpt-live-transcribe`. + """ + language: str """The language of the input audio. @@ -24,10 +32,19 @@ class AudioTranscriptionParam(TypedDict, total=False): format will improve accuracy and latency. """ + languages: SequenceNotStr[str] + """ + Possible languages of the input audio, in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format. + Supported by `gpt-transcribe` and `gpt-live-transcribe`. + """ + model: Union[ str, Literal[ "whisper-1", + "gpt-transcribe", + "gpt-live-transcribe", "gpt-4o-mini-transcribe", "gpt-4o-mini-transcribe-2025-12-15", "gpt-4o-transcribe", @@ -37,10 +54,10 @@ class AudioTranscriptionParam(TypedDict, total=False): ] """The model to use for transcription. - Current options are `whisper-1`, `gpt-4o-mini-transcribe`, - `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, - `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. Use - `gpt-4o-transcribe-diarize` when you need diarization with speaker labels. + Current options are `whisper-1`, `gpt-transcribe`, `gpt-live-transcribe`, + `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, + `gpt-4o-transcribe`, `gpt-4o-transcribe-diarize`, and `gpt-realtime-whisper`. + Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels. """ prompt: str diff --git a/src/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py b/src/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py index 3304233f8f..e68f163806 100644 --- a/src/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py +++ b/src/openai/types/realtime/conversation_item_input_audio_transcription_completed_event.py @@ -5,6 +5,7 @@ from ..._models import BaseModel from .log_prob_properties import LogProbProperties +from ..audio.transcription_language import TranscriptionLanguage __all__ = [ "ConversationItemInputAudioTranscriptionCompletedEvent", @@ -94,5 +95,12 @@ class ConversationItemInputAudioTranscriptionCompletedEvent(BaseModel): model's pricing rather than the realtime model's pricing. """ + languages: Optional[List[TranscriptionLanguage]] = None + """The languages detected in the audio. + + Returned by `gpt-transcribe`. An empty array indicates that no language could be + reliably detected. + """ + logprobs: Optional[List[LogProbProperties]] = None """The log probabilities of the transcription.""" diff --git a/src/openai/types/webhooks/__init__.py b/src/openai/types/webhooks/__init__.py index dcb4f3dec4..0ef3fa2236 100644 --- a/src/openai/types/webhooks/__init__.py +++ b/src/openai/types/webhooks/__init__.py @@ -11,6 +11,7 @@ from .response_failed_webhook_event import ResponseFailedWebhookEvent as ResponseFailedWebhookEvent from .eval_run_canceled_webhook_event import EvalRunCanceledWebhookEvent as EvalRunCanceledWebhookEvent from .eval_run_succeeded_webhook_event import EvalRunSucceededWebhookEvent as EvalRunSucceededWebhookEvent +from .live_call_incoming_webhook_event import LiveCallIncomingWebhookEvent as LiveCallIncomingWebhookEvent from .response_cancelled_webhook_event import ResponseCancelledWebhookEvent as ResponseCancelledWebhookEvent from .response_completed_webhook_event import ResponseCompletedWebhookEvent as ResponseCompletedWebhookEvent from .response_incomplete_webhook_event import ResponseIncompleteWebhookEvent as ResponseIncompleteWebhookEvent diff --git a/src/openai/types/webhooks/live_call_incoming_webhook_event.py b/src/openai/types/webhooks/live_call_incoming_webhook_event.py new file mode 100644 index 0000000000..2fd4c03fdc --- /dev/null +++ b/src/openai/types/webhooks/live_call_incoming_webhook_event.py @@ -0,0 +1,55 @@ +# 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__ = ["LiveCallIncomingWebhookEvent", "Data", "DataSipHeader"] + + +class DataSipHeader(BaseModel): + """A header from the SIP Invite.""" + + name: str + """Name of the SIP Header.""" + + value: str + """Value of the SIP Header.""" + + +class Data(BaseModel): + """Event data payload.""" + + session_id: str + """The Transceiver `rtc_...` ID of the pending SIP session. + + The same value appears as `call_id` in `realtime.call.incoming`. + """ + + sip_headers: List[DataSipHeader] + """Headers from the SIP Invite.""" + + +class LiveCallIncomingWebhookEvent(BaseModel): + """Sent when an incoming API SIP session is available for Live acceptance. + + The + same pending session can also emit `realtime.call.incoming`; the first + successful Realtime or Live accept endpoint selects the runtime surface. + """ + + id: str + """The unique ID of the event.""" + + created_at: int + """The Unix timestamp (in seconds) of when the event was created.""" + + data: Data + """Event data payload.""" + + type: Literal["live.call.incoming"] + """The type of the event. Always `live.call.incoming`.""" + + object: Optional[Literal["event"]] = None + """The object of the event. Always `event`.""" diff --git a/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py b/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py index 4647a2e2ba..2315f97654 100644 --- a/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py +++ b/src/openai/types/webhooks/realtime_call_incoming_webhook_event.py @@ -22,14 +22,21 @@ class Data(BaseModel): """Event data payload.""" call_id: str - """The unique ID of this call.""" + """The Transceiver `rtc_...` ID of the pending SIP session. + + The same value appears as `session_id` in `live.call.incoming`. + """ sip_headers: List[DataSipHeader] """Headers from the SIP Invite.""" class RealtimeCallIncomingWebhookEvent(BaseModel): - """Sent when Realtime API Receives a incoming SIP call.""" + """ + Sent when an incoming API SIP session is available for Realtime acceptance. + The same pending session can also emit `live.call.incoming`; the first + successful Realtime or Live accept endpoint selects the runtime surface. + """ id: str """The unique ID of the event.""" diff --git a/src/openai/types/webhooks/unwrap_webhook_event.py b/src/openai/types/webhooks/unwrap_webhook_event.py index 952383c049..eefc6b1c7b 100644 --- a/src/openai/types/webhooks/unwrap_webhook_event.py +++ b/src/openai/types/webhooks/unwrap_webhook_event.py @@ -12,6 +12,7 @@ from .response_failed_webhook_event import ResponseFailedWebhookEvent from .eval_run_canceled_webhook_event import EvalRunCanceledWebhookEvent from .eval_run_succeeded_webhook_event import EvalRunSucceededWebhookEvent +from .live_call_incoming_webhook_event import LiveCallIncomingWebhookEvent from .response_cancelled_webhook_event import ResponseCancelledWebhookEvent from .response_completed_webhook_event import ResponseCompletedWebhookEvent from .response_incomplete_webhook_event import ResponseIncompleteWebhookEvent @@ -34,6 +35,7 @@ FineTuningJobCancelledWebhookEvent, FineTuningJobFailedWebhookEvent, FineTuningJobSucceededWebhookEvent, + LiveCallIncomingWebhookEvent, RealtimeCallIncomingWebhookEvent, ResponseCancelledWebhookEvent, ResponseCompletedWebhookEvent, diff --git a/tests/api_resources/audio/test_transcriptions.py b/tests/api_resources/audio/test_transcriptions.py index b4525937b4..5d846fbfc0 100644 --- a/tests/api_resources/audio/test_transcriptions.py +++ b/tests/api_resources/audio/test_transcriptions.py @@ -32,9 +32,11 @@ def test_method_create_with_all_params_overload_1(self, client: OpenAI) -> None: model="gpt-4o-transcribe", chunking_strategy="auto", include=["logprobs"], + keywords=["string"], known_speaker_names=["string"], known_speaker_references=["string"], language="language", + languages=["string"], prompt="prompt", response_format="json", stream=False, @@ -86,9 +88,11 @@ def test_method_create_with_all_params_overload_2(self, client: OpenAI) -> None: stream=True, chunking_strategy="auto", include=["logprobs"], + keywords=["string"], known_speaker_names=["string"], known_speaker_references=["string"], language="language", + languages=["string"], prompt="prompt", response_format="json", temperature=0, @@ -144,9 +148,11 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn model="gpt-4o-transcribe", chunking_strategy="auto", include=["logprobs"], + keywords=["string"], known_speaker_names=["string"], known_speaker_references=["string"], language="language", + languages=["string"], prompt="prompt", response_format="json", stream=False, @@ -198,9 +204,11 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn stream=True, chunking_strategy="auto", include=["logprobs"], + keywords=["string"], known_speaker_names=["string"], known_speaker_references=["string"], language="language", + languages=["string"], prompt="prompt", response_format="json", temperature=0, diff --git a/tests/api_resources/realtime/test_calls.py b/tests/api_resources/realtime/test_calls.py index 3d87a77f3b..e8675a818f 100644 --- a/tests/api_resources/realtime/test_calls.py +++ b/tests/api_resources/realtime/test_calls.py @@ -48,7 +48,9 @@ def test_method_create_with_all_params(self, client: OpenAI, respx_mock: MockRou "noise_reduction": {"type": "near_field"}, "transcription": { "delay": "minimal", + "keywords": ["string"], "language": "language", + "languages": ["string"], "model": "whisper-1", "prompt": "prompt", }, @@ -150,7 +152,9 @@ def test_method_accept_with_all_params(self, client: OpenAI) -> None: "noise_reduction": {"type": "near_field"}, "transcription": { "delay": "minimal", + "keywords": ["string"], "language": "language", + "languages": ["string"], "model": "whisper-1", "prompt": "prompt", }, @@ -392,7 +396,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI, re "noise_reduction": {"type": "near_field"}, "transcription": { "delay": "minimal", + "keywords": ["string"], "language": "language", + "languages": ["string"], "model": "whisper-1", "prompt": "prompt", }, @@ -494,7 +500,9 @@ async def test_method_accept_with_all_params(self, async_client: AsyncOpenAI) -> "noise_reduction": {"type": "near_field"}, "transcription": { "delay": "minimal", + "keywords": ["string"], "language": "language", + "languages": ["string"], "model": "whisper-1", "prompt": "prompt", }, diff --git a/tests/api_resources/realtime/test_client_secrets.py b/tests/api_resources/realtime/test_client_secrets.py index c8ec8f3d3b..15f3043d54 100644 --- a/tests/api_resources/realtime/test_client_secrets.py +++ b/tests/api_resources/realtime/test_client_secrets.py @@ -40,7 +40,9 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None: "noise_reduction": {"type": "near_field"}, "transcription": { "delay": "minimal", + "keywords": ["string"], "language": "language", + "languages": ["string"], "model": "whisper-1", "prompt": "prompt", }, @@ -139,7 +141,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) -> "noise_reduction": {"type": "near_field"}, "transcription": { "delay": "minimal", + "keywords": ["string"], "language": "language", + "languages": ["string"], "model": "whisper-1", "prompt": "prompt", },