Commit 56540b32
Changed files (14)
src
openai
resources
beta
realtime
types
tests
api_resources
beta
realtime
src/openai/resources/beta/realtime/sessions.py
@@ -54,14 +54,17 @@ class Sessions(SyncAPIResource):
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
"gpt-4o-realtime-preview-2024-12-17",
+ "gpt-4o-realtime-preview-2025-06-03",
"gpt-4o-mini-realtime-preview",
"gpt-4o-mini-realtime-preview-2024-12-17",
]
| NotGiven = NOT_GIVEN,
output_audio_format: Literal["pcm16", "g711_ulaw", "g711_alaw"] | NotGiven = NOT_GIVEN,
+ speed: float | NotGiven = NOT_GIVEN,
temperature: float | NotGiven = NOT_GIVEN,
tool_choice: str | NotGiven = NOT_GIVEN,
tools: Iterable[session_create_params.Tool] | NotGiven = NOT_GIVEN,
+ tracing: session_create_params.Tracing | NotGiven = NOT_GIVEN,
turn_detection: session_create_params.TurnDetection | NotGiven = NOT_GIVEN,
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
@@ -129,6 +132,10 @@ class Sessions(SyncAPIResource):
output_audio_format: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
For `pcm16`, output audio is sampled at a rate of 24kHz.
+ speed: The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
+ minimum speed. 1.5 is the maximum speed. This value can only be changed in
+ between model turns, not while a response is in progress.
+
temperature: Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
temperature of 0.8 is highly recommended for best performance.
@@ -137,6 +144,12 @@ class Sessions(SyncAPIResource):
tools: Tools (functions) available to the model.
+ tracing: Configuration options for tracing. Set to null to disable tracing. Once tracing
+ is enabled for a session, the configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+
turn_detection: Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
set to `null` to turn off, in which case the client must manually trigger model
response. Server VAD means that the model will detect the start and end of
@@ -175,9 +188,11 @@ class Sessions(SyncAPIResource):
"modalities": modalities,
"model": model,
"output_audio_format": output_audio_format,
+ "speed": speed,
"temperature": temperature,
"tool_choice": tool_choice,
"tools": tools,
+ "tracing": tracing,
"turn_detection": turn_detection,
"voice": voice,
},
@@ -224,14 +239,17 @@ class AsyncSessions(AsyncAPIResource):
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
"gpt-4o-realtime-preview-2024-12-17",
+ "gpt-4o-realtime-preview-2025-06-03",
"gpt-4o-mini-realtime-preview",
"gpt-4o-mini-realtime-preview-2024-12-17",
]
| NotGiven = NOT_GIVEN,
output_audio_format: Literal["pcm16", "g711_ulaw", "g711_alaw"] | NotGiven = NOT_GIVEN,
+ speed: float | NotGiven = NOT_GIVEN,
temperature: float | NotGiven = NOT_GIVEN,
tool_choice: str | NotGiven = NOT_GIVEN,
tools: Iterable[session_create_params.Tool] | NotGiven = NOT_GIVEN,
+ tracing: session_create_params.Tracing | NotGiven = NOT_GIVEN,
turn_detection: session_create_params.TurnDetection | NotGiven = NOT_GIVEN,
voice: Union[
str, Literal["alloy", "ash", "ballad", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse"]
@@ -299,6 +317,10 @@ class AsyncSessions(AsyncAPIResource):
output_audio_format: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
For `pcm16`, output audio is sampled at a rate of 24kHz.
+ speed: The speed of the model's spoken response. 1.0 is the default speed. 0.25 is the
+ minimum speed. 1.5 is the maximum speed. This value can only be changed in
+ between model turns, not while a response is in progress.
+
temperature: Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a
temperature of 0.8 is highly recommended for best performance.
@@ -307,6 +329,12 @@ class AsyncSessions(AsyncAPIResource):
tools: Tools (functions) available to the model.
+ tracing: Configuration options for tracing. Set to null to disable tracing. Once tracing
+ is enabled for a session, the configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+
turn_detection: Configuration for turn detection, ether Server VAD or Semantic VAD. This can be
set to `null` to turn off, in which case the client must manually trigger model
response. Server VAD means that the model will detect the start and end of
@@ -345,9 +373,11 @@ class AsyncSessions(AsyncAPIResource):
"modalities": modalities,
"model": model,
"output_audio_format": output_audio_format,
+ "speed": speed,
"temperature": temperature,
"tool_choice": tool_choice,
"tools": tools,
+ "tracing": tracing,
"turn_detection": turn_detection,
"voice": voice,
},
src/openai/types/beta/realtime/session.py
@@ -1,11 +1,19 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
-from typing_extensions import Literal
+from typing_extensions import Literal, TypeAlias
from ...._models import BaseModel
-__all__ = ["Session", "InputAudioNoiseReduction", "InputAudioTranscription", "Tool", "TurnDetection"]
+__all__ = [
+ "Session",
+ "InputAudioNoiseReduction",
+ "InputAudioTranscription",
+ "Tool",
+ "Tracing",
+ "TracingTracingConfiguration",
+ "TurnDetection",
+]
class InputAudioNoiseReduction(BaseModel):
@@ -59,6 +67,29 @@ class Tool(BaseModel):
"""The type of the tool, i.e. `function`."""
+class TracingTracingConfiguration(BaseModel):
+ group_id: Optional[str] = None
+ """
+ The group id to attach to this trace to enable filtering and grouping in the
+ traces dashboard.
+ """
+
+ metadata: Optional[object] = None
+ """
+ The arbitrary metadata to attach to this trace to enable filtering in the traces
+ dashboard.
+ """
+
+ workflow_name: Optional[str] = None
+ """The name of the workflow to attach to this trace.
+
+ This is used to name the trace in the traces dashboard.
+ """
+
+
+Tracing: TypeAlias = Union[Literal["auto"], TracingTracingConfiguration]
+
+
class TurnDetection(BaseModel):
create_response: Optional[bool] = None
"""
@@ -175,6 +206,7 @@ class Session(BaseModel):
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
"gpt-4o-realtime-preview-2024-12-17",
+ "gpt-4o-realtime-preview-2025-06-03",
"gpt-4o-mini-realtime-preview",
"gpt-4o-mini-realtime-preview-2024-12-17",
]
@@ -188,6 +220,14 @@ class Session(BaseModel):
sampled at a rate of 24kHz.
"""
+ speed: Optional[float] = None
+ """The speed of the model's spoken response.
+
+ 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
+ This value can only be changed in between model turns, not while a response is
+ in progress.
+ """
+
temperature: Optional[float] = None
"""Sampling temperature for the model, limited to [0.6, 1.2].
@@ -204,6 +244,16 @@ class Session(BaseModel):
tools: Optional[List[Tool]] = None
"""Tools (functions) available to the model."""
+ tracing: Optional[Tracing] = None
+ """Configuration options for tracing.
+
+ Set to null to disable tracing. Once tracing is enabled for a session, the
+ configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+ """
+
turn_detection: Optional[TurnDetection] = None
"""Configuration for turn detection, ether Server VAD or Semantic VAD.
@@ -227,5 +277,5 @@ class Session(BaseModel):
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` and `verse`.
+ `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
"""
src/openai/types/beta/realtime/session_create_params.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable
-from typing_extensions import Literal, TypedDict
+from typing_extensions import Literal, TypeAlias, TypedDict
__all__ = [
"SessionCreateParams",
@@ -12,6 +12,8 @@ __all__ = [
"InputAudioNoiseReduction",
"InputAudioTranscription",
"Tool",
+ "Tracing",
+ "TracingTracingConfiguration",
"TurnDetection",
]
@@ -82,6 +84,7 @@ class SessionCreateParams(TypedDict, total=False):
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
"gpt-4o-realtime-preview-2024-12-17",
+ "gpt-4o-realtime-preview-2025-06-03",
"gpt-4o-mini-realtime-preview",
"gpt-4o-mini-realtime-preview-2024-12-17",
]
@@ -94,6 +97,14 @@ class SessionCreateParams(TypedDict, total=False):
sampled at a rate of 24kHz.
"""
+ speed: float
+ """The speed of the model's spoken response.
+
+ 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
+ This value can only be changed in between model turns, not while a response is
+ in progress.
+ """
+
temperature: float
"""Sampling temperature for the model, limited to [0.6, 1.2].
@@ -110,6 +121,16 @@ class SessionCreateParams(TypedDict, total=False):
tools: Iterable[Tool]
"""Tools (functions) available to the model."""
+ tracing: Tracing
+ """Configuration options for tracing.
+
+ Set to null to disable tracing. Once tracing is enabled for a session, the
+ configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+ """
+
turn_detection: TurnDetection
"""Configuration for turn detection, ether Server VAD or Semantic VAD.
@@ -205,6 +226,29 @@ class Tool(TypedDict, total=False):
"""The type of the tool, i.e. `function`."""
+class TracingTracingConfiguration(TypedDict, total=False):
+ group_id: str
+ """
+ The group id to attach to this trace to enable filtering and grouping in the
+ traces dashboard.
+ """
+
+ metadata: object
+ """
+ The arbitrary metadata to attach to this trace to enable filtering in the traces
+ dashboard.
+ """
+
+ workflow_name: str
+ """The name of the workflow to attach to this trace.
+
+ This is used to name the trace in the traces dashboard.
+ """
+
+
+Tracing: TypeAlias = Union[Literal["auto"], TracingTracingConfiguration]
+
+
class TurnDetection(TypedDict, total=False):
create_response: bool
"""
src/openai/types/beta/realtime/session_create_response.py
@@ -1,11 +1,19 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
-from typing_extensions import Literal
+from typing_extensions import Literal, TypeAlias
from ...._models import BaseModel
-__all__ = ["SessionCreateResponse", "ClientSecret", "InputAudioTranscription", "Tool", "TurnDetection"]
+__all__ = [
+ "SessionCreateResponse",
+ "ClientSecret",
+ "InputAudioTranscription",
+ "Tool",
+ "Tracing",
+ "TracingTracingConfiguration",
+ "TurnDetection",
+]
class ClientSecret(BaseModel):
@@ -48,6 +56,29 @@ class Tool(BaseModel):
"""The type of the tool, i.e. `function`."""
+class TracingTracingConfiguration(BaseModel):
+ group_id: Optional[str] = None
+ """
+ The group id to attach to this trace to enable filtering and grouping in the
+ traces dashboard.
+ """
+
+ metadata: Optional[object] = None
+ """
+ The arbitrary metadata to attach to this trace to enable filtering in the traces
+ dashboard.
+ """
+
+ workflow_name: Optional[str] = None
+ """The name of the workflow to attach to this trace.
+
+ This is used to name the trace in the traces dashboard.
+ """
+
+
+Tracing: TypeAlias = Union[Literal["auto"], TracingTracingConfiguration]
+
+
class TurnDetection(BaseModel):
prefix_padding_ms: Optional[int] = None
"""Amount of audio to include before the VAD detected speech (in milliseconds).
@@ -121,6 +152,14 @@ class SessionCreateResponse(BaseModel):
output_audio_format: Optional[str] = None
"""The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`."""
+ speed: Optional[float] = None
+ """The speed of the model's spoken response.
+
+ 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
+ This value can only be changed in between model turns, not while a response is
+ in progress.
+ """
+
temperature: Optional[float] = None
"""Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8."""
@@ -133,6 +172,16 @@ class SessionCreateResponse(BaseModel):
tools: Optional[List[Tool]] = None
"""Tools (functions) available to the model."""
+ tracing: Optional[Tracing] = None
+ """Configuration options for tracing.
+
+ Set to null to disable tracing. Once tracing is enabled for a session, the
+ configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+ """
+
turn_detection: Optional[TurnDetection] = None
"""Configuration for turn detection.
src/openai/types/beta/realtime/session_update_event.py
@@ -1,7 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
-from typing_extensions import Literal
+from typing_extensions import Literal, TypeAlias
from ...._models import BaseModel
@@ -13,6 +13,8 @@ __all__ = [
"SessionInputAudioNoiseReduction",
"SessionInputAudioTranscription",
"SessionTool",
+ "SessionTracing",
+ "SessionTracingTracingConfiguration",
"SessionTurnDetection",
]
@@ -87,6 +89,29 @@ class SessionTool(BaseModel):
"""The type of the tool, i.e. `function`."""
+class SessionTracingTracingConfiguration(BaseModel):
+ group_id: Optional[str] = None
+ """
+ The group id to attach to this trace to enable filtering and grouping in the
+ traces dashboard.
+ """
+
+ metadata: Optional[object] = None
+ """
+ The arbitrary metadata to attach to this trace to enable filtering in the traces
+ dashboard.
+ """
+
+ workflow_name: Optional[str] = None
+ """The name of the workflow to attach to this trace.
+
+ This is used to name the trace in the traces dashboard.
+ """
+
+
+SessionTracing: TypeAlias = Union[Literal["auto"], SessionTracingTracingConfiguration]
+
+
class SessionTurnDetection(BaseModel):
create_response: Optional[bool] = None
"""
@@ -203,6 +228,7 @@ class Session(BaseModel):
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
"gpt-4o-realtime-preview-2024-12-17",
+ "gpt-4o-realtime-preview-2025-06-03",
"gpt-4o-mini-realtime-preview",
"gpt-4o-mini-realtime-preview-2024-12-17",
]
@@ -216,6 +242,14 @@ class Session(BaseModel):
sampled at a rate of 24kHz.
"""
+ speed: Optional[float] = None
+ """The speed of the model's spoken response.
+
+ 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
+ This value can only be changed in between model turns, not while a response is
+ in progress.
+ """
+
temperature: Optional[float] = None
"""Sampling temperature for the model, limited to [0.6, 1.2].
@@ -232,6 +266,16 @@ class Session(BaseModel):
tools: Optional[List[SessionTool]] = None
"""Tools (functions) available to the model."""
+ tracing: Optional[SessionTracing] = None
+ """Configuration options for tracing.
+
+ Set to null to disable tracing. Once tracing is enabled for a session, the
+ configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+ """
+
turn_detection: Optional[SessionTurnDetection] = None
"""Configuration for turn detection, ether Server VAD or Semantic VAD.
src/openai/types/beta/realtime/session_update_event_param.py
@@ -3,7 +3,7 @@
from __future__ import annotations
from typing import List, Union, Iterable
-from typing_extensions import Literal, Required, TypedDict
+from typing_extensions import Literal, Required, TypeAlias, TypedDict
__all__ = [
"SessionUpdateEventParam",
@@ -13,6 +13,8 @@ __all__ = [
"SessionInputAudioNoiseReduction",
"SessionInputAudioTranscription",
"SessionTool",
+ "SessionTracing",
+ "SessionTracingTracingConfiguration",
"SessionTurnDetection",
]
@@ -87,6 +89,29 @@ class SessionTool(TypedDict, total=False):
"""The type of the tool, i.e. `function`."""
+class SessionTracingTracingConfiguration(TypedDict, total=False):
+ group_id: str
+ """
+ The group id to attach to this trace to enable filtering and grouping in the
+ traces dashboard.
+ """
+
+ metadata: object
+ """
+ The arbitrary metadata to attach to this trace to enable filtering in the traces
+ dashboard.
+ """
+
+ workflow_name: str
+ """The name of the workflow to attach to this trace.
+
+ This is used to name the trace in the traces dashboard.
+ """
+
+
+SessionTracing: TypeAlias = Union[Literal["auto"], SessionTracingTracingConfiguration]
+
+
class SessionTurnDetection(TypedDict, total=False):
create_response: bool
"""
@@ -202,6 +227,7 @@ class Session(TypedDict, total=False):
"gpt-4o-realtime-preview",
"gpt-4o-realtime-preview-2024-10-01",
"gpt-4o-realtime-preview-2024-12-17",
+ "gpt-4o-realtime-preview-2025-06-03",
"gpt-4o-mini-realtime-preview",
"gpt-4o-mini-realtime-preview-2024-12-17",
]
@@ -214,6 +240,14 @@ class Session(TypedDict, total=False):
sampled at a rate of 24kHz.
"""
+ speed: float
+ """The speed of the model's spoken response.
+
+ 1.0 is the default speed. 0.25 is the minimum speed. 1.5 is the maximum speed.
+ This value can only be changed in between model turns, not while a response is
+ in progress.
+ """
+
temperature: float
"""Sampling temperature for the model, limited to [0.6, 1.2].
@@ -230,6 +264,16 @@ class Session(TypedDict, total=False):
tools: Iterable[SessionTool]
"""Tools (functions) available to the model."""
+ tracing: SessionTracing
+ """Configuration options for tracing.
+
+ Set to null to disable tracing. Once tracing is enabled for a session, the
+ configuration cannot be modified.
+
+ `auto` will create a trace for the session with default values for the workflow
+ name, group id, and metadata.
+ """
+
turn_detection: SessionTurnDetection
"""Configuration for turn detection, ether Server VAD or Semantic VAD.
src/openai/_version.py
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "openai"
-__version__ = "1.83.0" # x-release-please-version
+__version__ = "1.84.0" # x-release-please-version
tests/api_resources/beta/realtime/test_sessions.py
@@ -43,6 +43,7 @@ class TestSessions:
modalities=["text"],
model="gpt-4o-realtime-preview",
output_audio_format="pcm16",
+ speed=0.25,
temperature=0,
tool_choice="tool_choice",
tools=[
@@ -53,6 +54,7 @@ class TestSessions:
"type": "function",
}
],
+ tracing="auto",
turn_detection={
"create_response": True,
"eagerness": "low",
@@ -116,6 +118,7 @@ class TestAsyncSessions:
modalities=["text"],
model="gpt-4o-realtime-preview",
output_audio_format="pcm16",
+ speed=0.25,
temperature=0,
tool_choice="tool_choice",
tools=[
@@ -126,6 +129,7 @@ class TestAsyncSessions:
"type": "function",
}
],
+ tracing="auto",
turn_detection={
"create_response": True,
"eagerness": "low",
.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "1.83.0"
+ ".": "1.84.0"
}
\ No newline at end of file
.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 111
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2bcc845d8635bf93ddcf9ee723af4d7928248412a417bee5fc10d863a1e13867.yml
-openapi_spec_hash: 865230cb3abeb01bd85de05891af23c4
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-0205acb1015d29b2312a48526734c0399f93026d4fe2dff5c7768f566e333fd2.yml
+openapi_spec_hash: 1772cc9056c2f6dfb2a4e9cb77ee6343
config_hash: ed1e6b3c5f93d12b80d31167f55c557c
CHANGELOG.md
@@ -1,5 +1,18 @@
# Changelog
+## 1.84.0 (2025-06-03)
+
+Full Changelog: [v1.83.0...v1.84.0](https://github.com/openai/openai-python/compare/v1.83.0...v1.84.0)
+
+### Features
+
+* **api:** add new realtime and audio models, realtime session options ([0acd0da](https://github.com/openai/openai-python/commit/0acd0da6bc0468c6c857711bc5e77d0bc6d31be6))
+
+
+### Chores
+
+* **api:** update type names ([1924559](https://github.com/openai/openai-python/commit/192455913b38bf0323ddd0e2b1499b114e2111a1))
+
## 1.83.0 (2025-06-02)
Full Changelog: [v1.82.1...v1.83.0](https://github.com/openai/openai-python/compare/v1.82.1...v1.83.0)
pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "openai"
-version = "1.83.0"
+version = "1.84.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"