diff --git a/.castiron.stats.yml b/.castiron.stats.yml index 23b33efd22..3e48e35d8c 100644 --- a/.castiron.stats.yml +++ b/.castiron.stats.yml @@ -1,7 +1,7 @@ schema_version: 1 -generation_id: 02a4f051-9120-487b-8954-9ea8b97df229 -openapi_spec_hash: 017866de8f67cefec8724f830463cbe2 -openapi_transformed_spec_hash: d7de2a7f65152a983cdba4c6b4a20d76 -config_hash: 3d64bda5a8bbef3ad0572848ae7e87f7 -codegen_sha: ab8360c6a37ccd1f94712f0aa9646349279084b1 -codegen_hash: cd27c533727eae2ee5d4350f07afd15d7de38e89fd3c4c2e35dbda61cd39f5d8 +generation_id: 27aedac3-d226-45f3-9b03-cdbc31e26c4a +openapi_spec_hash: 6e0c0f870093ed93cda3b6c04057dff1 +openapi_transformed_spec_hash: 6dca3c69339704dc304046890bab23a2 +config_hash: 8a684aec06907ff8ced7809753e16225 +codegen_sha: a437bfc5da2d18f1d2cf8b2e0dabf33cbce30762 +codegen_hash: 7c728907f3820a04cdb65380930c806a947d51378d79412f730f857ec317f0bf diff --git a/api_reference/openapi.transformed.yml b/api_reference/openapi.transformed.yml index 2b783ff234..0851d765e6 100644 --- a/api_reference/openapi.transformed.yml +++ b/api_reference/openapi.transformed.yml @@ -52062,6 +52062,7 @@ components: - $ref: '#/components/schemas/LiveInputAudioMuteParam' - $ref: '#/components/schemas/LiveInputAudioUnmuteParam' - $ref: '#/components/schemas/LiveOutputAudioFixturePlayParam' + - $ref: '#/components/schemas/LiveTransportDTMFSendParam' - $ref: '#/components/schemas/LiveInstructionsAppendParam' - $ref: '#/components/schemas/LiveThinkingAppendParam' - $ref: '#/components/schemas/LiveCommentaryAppendParam' @@ -52117,6 +52118,7 @@ components: - $ref: '#/components/schemas/LiveOutputAudioDelta' - $ref: '#/components/schemas/LiveTransportDTMFReceived' - $ref: '#/components/schemas/LiveTransportDTMFSend' + - $ref: '#/components/schemas/LiveTransportDTMFSent' - $ref: '#/components/schemas/LiveTransportRinging' - $ref: '#/components/schemas/LiveTransportAnswered' - $ref: '#/components/schemas/LiveTransportFailed' @@ -79111,6 +79113,41 @@ components: - auto - none - required + LiveTransportDTMFSend: + description: Legacy SIP DTMF delivery notification retained for SDK compatibility and saved events. Current servers confirm delivery with transport.dtmf.sent; transport.dtmf.send is now the client command. + example: + type: transport.dtmf.send + event_id: event_dtmf_2 + event: '#' + type: object + properties: + type: + default: transport.dtmf.send + x-stainless-const: true + type: string + enum: + - transport.dtmf.send + event_id: + type: string + event: + type: string + minLength: 1 + maxLength: 1 + pattern: ^[0-9A-D*#]$ + client_event_id: + description: The event_id of the client command, when supplied. + type: string + x-stainless-skip: + - cli + required: + - type + - event_id + - event + x-oaiMeta: + example: + type: transport.dtmf.send + event_id: event_dtmf_2 + event: '#' LegacyComputerAction: discriminator: propertyName: type @@ -79124,42 +79161,6 @@ components: - $ref: '#/components/schemas/ScrollParam' - $ref: '#/components/schemas/TypeParam' - $ref: '#/components/schemas/WaitParam' - CodeInterpreterContainerAuto: - properties: - type: - type: string - enum: - - auto - description: Always `auto`. - default: auto - x-stainless-const: true - file_ids: - items: - type: string - example: file-123 - type: array - maxItems: 50 - description: An optional list of uploaded files to make available to your code. - memory_limit: - anyOf: - - $ref: '#/components/schemas/ContainerMemoryLimit' - description: The memory limit for the code interpreter container. - - type: 'null' - network_policy: - discriminator: - propertyName: type - description: Network access policy for the container. - anyOf: - - $ref: '#/components/schemas/ContainerNetworkPolicyDisabledParam' - - $ref: '#/components/schemas/ContainerNetworkPolicyAllowlistParam' - type: object - required: - - type - title: CodeInterpreterToolAuto - description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - x-stainless-naming: - go: - type_name: ToolCodeInterpreterContainerCodeInterpreterContainerAuto LiveSpecificFileSearchParam: type: object properties: @@ -97649,41 +97650,6 @@ components: type: transport.dtmf.received event_id: event_dtmf_1 event: '5' - LiveTransportDTMFSend: - description: A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command. - example: - type: transport.dtmf.send - event_id: event_dtmf_2 - event: '#' - type: object - properties: - type: - default: transport.dtmf.send - x-stainless-const: true - type: string - enum: - - transport.dtmf.send - event_id: - type: string - event: - type: string - minLength: 1 - maxLength: 1 - pattern: ^[0-9A-D*#]$ - client_event_id: - description: The event_id of the client command, when supplied. - type: string - x-stainless-skip: - - cli - required: - - type - - event_id - - event - x-oaiMeta: - example: - type: transport.dtmf.send - event_id: event_dtmf_2 - event: '#' LiveTransportRinging: description: The outbound SIP provider leg is ringing or providing early media. Delivered only to sideband observers. example: @@ -97831,6 +97797,7 @@ components: - $ref: '#/components/schemas/LiveInfoEvent' - $ref: '#/components/schemas/LiveTransportDTMFReceived' - $ref: '#/components/schemas/LiveTransportDTMFSend' + - $ref: '#/components/schemas/LiveTransportDTMFSent' - $ref: '#/components/schemas/LiveTransportRinging' - $ref: '#/components/schemas/LiveTransportAnswered' - $ref: '#/components/schemas/LiveTransportFailed' @@ -111027,6 +110994,73 @@ components: type: object required: - status + LiveTransportDTMFSendParam: + description: Send one DTMF keypress to the SIP trunk through a Live sideband connection. This command is supported only for SIP calls. A successful send emits `transport.dtmf.sent` on sideband. If you provide `event_id`, the success notification includes it as `client_event_id`; a failure includes it as `error.client_event_id`. Send separate events for multiple keypresses. + example: + type: transport.dtmf.send + event_id: evt_dtmf_001 + event: '#' + type: object + properties: + event_id: + anyOf: + - description: Optional client identifier for correlating this command with a server event's client_event_id or error.client_event_id. + type: string + maxLength: 512 + - type: 'null' + type: + default: transport.dtmf.send + x-stainless-const: true + type: string + enum: + - transport.dtmf.send + event: + description: 'The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.' + type: string + minLength: 1 + maxLength: 1 + pattern: ^[0-9A-D*#]$ + required: + - type + - event + x-oaiMeta: + example: + type: transport.dtmf.send + event_id: evt_dtmf_001 + event: '#' + LiveTransportDTMFSent: + description: A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command. + example: + type: transport.dtmf.sent + event_id: event_dtmf_2 + event: '#' + type: object + properties: + type: + default: transport.dtmf.sent + x-stainless-const: true + type: string + enum: + - transport.dtmf.sent + event_id: + type: string + event: + type: string + minLength: 1 + maxLength: 1 + pattern: ^[0-9A-D*#]$ + client_event_id: + description: The event_id of the client command, when supplied. + type: string + required: + - type + - event_id + - event + x-oaiMeta: + example: + type: transport.dtmf.sent + event_id: event_dtmf_2 + event: '#' SessionSpendControlResource: type: object properties: @@ -111813,6 +111847,42 @@ components: - completed - incomplete - expired + CodeInterpreterContainerAuto: + properties: + type: + type: string + enum: + - auto + description: Always `auto`. + default: auto + x-stainless-const: true + file_ids: + items: + type: string + example: file-123 + type: array + maxItems: 50 + description: An optional list of uploaded files to make available to your code. + memory_limit: + anyOf: + - $ref: '#/components/schemas/ContainerMemoryLimit' + description: The memory limit for the code interpreter container. + - type: 'null' + network_policy: + discriminator: + propertyName: type + description: Network access policy for the container. + anyOf: + - $ref: '#/components/schemas/ContainerNetworkPolicyDisabledParam' + - $ref: '#/components/schemas/ContainerNetworkPolicyAllowlistParam' + type: object + required: + - type + title: CodeInterpreterToolAuto + description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + x-stainless-naming: + go: + type_name: ToolCodeInterpreterContainerCodeInterpreterContainerAuto LiveFunctionToolChoiceParam: type: object properties: diff --git a/scripts/castiron/generated-files.json b/scripts/castiron/generated-files.json index bbc7b41e27..605ae3081d 100644 --- a/scripts/castiron/generated-files.json +++ b/scripts/castiron/generated-files.json @@ -571,7 +571,7 @@ }, "src/openai/resources/live/sideband.py": { "mode": "100644", - "sha256": "4ed10b89fadd3aff1e3226cd7e0db9e1463ef834ce3d2c1e437618c7292cbd20" + "sha256": "9f780c2c96066d0f2a70f48b5c7f4f610900a1d07371c7b19fd0a7b787e79120" }, "src/openai/resources/models.py": { "mode": "100644", @@ -4635,15 +4635,15 @@ }, "src/openai/types/live/connect_client_event.py": { "mode": "100644", - "sha256": "bc941c81d969470e47b82605313ca6beff3d40bf152eabe7ba0b6e6649cf2afa" + "sha256": "3dafdbb32c5765eaa39a1473d56f1b5113b2af596feac4fb4332b5632c5332fc" }, "src/openai/types/live/connect_client_event_param.py": { "mode": "100644", - "sha256": "b8f84462deda4beb537beb4f8dcf18a1be3bc842bc1679adb9d4fc66e1b8b18b" + "sha256": "348e243ff821cf55dd0c1a5f04aa5c83ee12221b033913314c7c25ffb47101da" }, "src/openai/types/live/connect_server_event.py": { "mode": "100644", - "sha256": "f1762b5ae9f57faaf5bc12d24497b6736a454d9c9b0a92bea8556ec5e191c948" + "sha256": "0ea5b662cd3893671b1ed1f89cc49852a8db23a4591ef6694a5a789e8aa253ed" }, "src/openai/types/live/custom_voice.py": { "mode": "100644", @@ -4823,7 +4823,7 @@ }, "src/openai/types/live/fork_server_event.py": { "mode": "100644", - "sha256": "a908fc4ff11c69feb00f2e5bdd57ec4af95fd5c7bbdf02a8dbf8b566257ae837" + "sha256": "e7b6e1523075c44d6a39125cbec89984be35a60c3b314f521768bca68f92caae" }, "src/openai/types/live/fork_session_config.py": { "mode": "100644", @@ -4987,7 +4987,7 @@ }, "src/openai/types/live/server_event.py": { "mode": "100644", - "sha256": "ab64c366facea5dd4ba3e487fc09227bb806401fee45d0512156507695f20feb" + "sha256": "6b7bbf4ebd0cafdccda1532cf059e9c6a4be2ea3c4fde83c2c3c3d30ab37ae2b" }, "src/openai/types/live/server_event_selector.py": { "mode": "100644", diff --git a/src/openai/resources/live/sideband.py b/src/openai/resources/live/sideband.py index c916ecfcd4..fca3846e44 100644 --- a/src/openai/resources/live/sideband.py +++ b/src/openai/resources/live/sideband.py @@ -115,6 +115,7 @@ class AsyncSidebandConnection(AsyncWebSocketConnectionBase): """Represents a live WebSocket connection to the Sideband API""" session: AsyncSidebandSessionResource + transport: AsyncSidebandTransportResource decision: AsyncSidebandDecisionResource response: AsyncSidebandResponseResource @@ -148,6 +149,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=False) self.session = AsyncSidebandSessionResource(self) + self.transport = AsyncSidebandTransportResource(self) self.decision = AsyncSidebandDecisionResource(self) self.response = AsyncSidebandResponseResource(self) @@ -544,6 +546,7 @@ class SidebandConnection(WebSocketConnectionBase): """Represents a live WebSocket connection to the Sideband API""" session: SidebandSessionResource + transport: SidebandTransportResource decision: SidebandDecisionResource response: SidebandResponseResource @@ -577,6 +580,7 @@ def __init__( self._event_handler_registry = EventHandlerRegistry(use_lock=True) self.session = SidebandSessionResource(self) + self.transport = SidebandTransportResource(self) self.decision = SidebandDecisionResource(self) self.response = SidebandResponseResource(self) @@ -1122,6 +1126,26 @@ def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> None: ) +class SidebandTransportResource(BaseSidebandConnectionResource): + @cached_property + def dtmf(self) -> SidebandTransportDtmfResource: + return SidebandTransportDtmfResource(self._connection) + + +class SidebandTransportDtmfResource(BaseSidebandConnectionResource): + def send(self, *, event: str, event_id: Optional[str] | Omit = omit) -> None: + """Send one DTMF keypress to the SIP trunk through a Live sideband connection. + + This command is supported only for SIP calls. A successful send emits `transport.dtmf.sent` on sideband. If you provide `event_id`, the success notification includes it as `client_event_id`; a failure includes it as `error.client_event_id`. Send separate events for multiple keypresses. + """ + self._connection.send( + cast( + ConnectClientEventParam, + strip_not_given({"type": "transport.dtmf.send", "event": event, "event_id": event_id}), + ) + ) + + class SidebandDecisionResource(BaseSidebandConnectionResource): @cached_property def item(self) -> SidebandDecisionItemResource: @@ -1357,6 +1381,26 @@ async def play(self, *, audio: str, event_id: Optional[str] | Omit = omit) -> No ) +class AsyncSidebandTransportResource(BaseAsyncSidebandConnectionResource): + @cached_property + def dtmf(self) -> AsyncSidebandTransportDtmfResource: + return AsyncSidebandTransportDtmfResource(self._connection) + + +class AsyncSidebandTransportDtmfResource(BaseAsyncSidebandConnectionResource): + async def send(self, *, event: str, event_id: Optional[str] | Omit = omit) -> None: + """Send one DTMF keypress to the SIP trunk through a Live sideband connection. + + This command is supported only for SIP calls. A successful send emits `transport.dtmf.sent` on sideband. If you provide `event_id`, the success notification includes it as `client_event_id`; a failure includes it as `error.client_event_id`. Send separate events for multiple keypresses. + """ + await self._connection.send( + cast( + ConnectClientEventParam, + strip_not_given({"type": "transport.dtmf.send", "event": event, "event_id": event_id}), + ) + ) + + class AsyncSidebandDecisionResource(BaseAsyncSidebandConnectionResource): @cached_property def item(self) -> AsyncSidebandDecisionItemResource: diff --git a/src/openai/types/live/connect_client_event.py b/src/openai/types/live/connect_client_event.py index 0d46cf6ef5..430e87cb8b 100644 --- a/src/openai/types/live/connect_client_event.py +++ b/src/openai/types/live/connect_client_event.py @@ -1,9 +1,10 @@ # File generated from our OpenAPI spec by Castiron. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import Annotated, TypeAlias +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo +from ..._models import BaseModel from .session_close_event import SessionCloseEvent from .session_update_event import SessionUpdateEvent from .decision_create_event import DecisionCreateEvent @@ -18,7 +19,26 @@ from .response_item_create_event import ResponseItemCreateEvent from .output_audio_fixture_play_event import OutputAudioFixturePlayEvent -__all__ = ["ConnectClientEvent"] +__all__ = ["ConnectClientEvent", "TransportDtmfSend"] + + +class TransportDtmfSend(BaseModel): + """Send one DTMF keypress to the SIP trunk through a Live sideband connection. + + This command is supported only for SIP calls. A successful send emits `transport.dtmf.sent` on sideband. If you provide `event_id`, the success notification includes it as `client_event_id`; a failure includes it as `error.client_event_id`. Send separate events for multiple keypresses. + """ + + event: str + """The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.""" + + type: Literal["transport.dtmf.send"] + + event_id: Optional[str] = None + """ + Optional client identifier for correlating this command with a server event's + client_event_id or error.client_event_id. + """ + ConnectClientEvent: TypeAlias = Annotated[ Union[ @@ -26,6 +46,7 @@ InputAudioMuteEvent, InputAudioUnmuteEvent, OutputAudioFixturePlayEvent, + TransportDtmfSend, InstructionsAppendEvent, ThinkingAppendEvent, CommentaryAppendEvent, diff --git a/src/openai/types/live/connect_client_event_param.py b/src/openai/types/live/connect_client_event_param.py index d4309ae7bb..71690d037f 100644 --- a/src/openai/types/live/connect_client_event_param.py +++ b/src/openai/types/live/connect_client_event_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Union -from typing_extensions import TypeAlias +from typing import Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .session_close_event_param import SessionCloseEventParam from .session_update_event_param import SessionUpdateEventParam @@ -19,13 +19,33 @@ from .response_item_create_event_param import ResponseItemCreateEventParam from .output_audio_fixture_play_event_param import OutputAudioFixturePlayEventParam -__all__ = ["ConnectClientEventParam"] +__all__ = ["ConnectClientEventParam", "TransportDtmfSend"] + + +class TransportDtmfSend(TypedDict, total=False): + """Send one DTMF keypress to the SIP trunk through a Live sideband connection. + + This command is supported only for SIP calls. A successful send emits `transport.dtmf.sent` on sideband. If you provide `event_id`, the success notification includes it as `client_event_id`; a failure includes it as `error.client_event_id`. Send separate events for multiple keypresses. + """ + + event: Required[str] + """The DTMF key to send: one of `0`–`9`, `A`–`D`, `*`, or `#`.""" + + type: Required[Literal["transport.dtmf.send"]] + + event_id: Optional[str] + """ + Optional client identifier for correlating this command with a server event's + client_event_id or error.client_event_id. + """ + ConnectClientEventParam: TypeAlias = Union[ SessionUpdateEventParam, InputAudioMuteEventParam, InputAudioUnmuteEventParam, OutputAudioFixturePlayEventParam, + TransportDtmfSend, InstructionsAppendEventParam, ThinkingAppendEventParam, CommentaryAppendEventParam, diff --git a/src/openai/types/live/connect_server_event.py b/src/openai/types/live/connect_server_event.py index 928f95aeae..217325632e 100644 --- a/src/openai/types/live/connect_server_event.py +++ b/src/openai/types/live/connect_server_event.py @@ -32,6 +32,7 @@ "SessionInputAudioAppend", "TransportDtmfReceived", "TransportDtmfSend", + "TransportDtmfSent", "TransportRinging", "TransportAnswered", "TransportFailed", @@ -69,6 +70,21 @@ class TransportDtmfReceived(BaseModel): class TransportDtmfSend(BaseModel): + """ + Legacy SIP DTMF delivery notification retained for SDK compatibility and saved events. Current servers confirm delivery with transport.dtmf.sent; transport.dtmf.send is now the client command. + """ + + event: str + + event_id: str + + type: Literal["transport.dtmf.send"] + + client_event_id: Optional[str] = None + """The event_id of the client command, when supplied.""" + + +class TransportDtmfSent(BaseModel): """A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command. @@ -78,7 +94,7 @@ class TransportDtmfSend(BaseModel): event_id: str - type: Literal["transport.dtmf.send"] + type: Literal["transport.dtmf.sent"] client_event_id: Optional[str] = None """The event_id of the client command, when supplied.""" @@ -166,6 +182,7 @@ class TransportFailed(BaseModel): OutputAudioDeltaEvent, TransportDtmfReceived, TransportDtmfSend, + TransportDtmfSent, TransportRinging, TransportAnswered, TransportFailed, diff --git a/src/openai/types/live/fork_server_event.py b/src/openai/types/live/fork_server_event.py index 88a006ab51..30ea40b5b2 100644 --- a/src/openai/types/live/fork_server_event.py +++ b/src/openai/types/live/fork_server_event.py @@ -32,6 +32,7 @@ "SessionInputAudioAppend", "TransportDtmfReceived", "TransportDtmfSend", + "TransportDtmfSent", "TransportRinging", "TransportAnswered", "TransportFailed", @@ -69,6 +70,21 @@ class TransportDtmfReceived(BaseModel): class TransportDtmfSend(BaseModel): + """ + Legacy SIP DTMF delivery notification retained for SDK compatibility and saved events. Current servers confirm delivery with transport.dtmf.sent; transport.dtmf.send is now the client command. + """ + + event: str + + event_id: str + + type: Literal["transport.dtmf.send"] + + client_event_id: Optional[str] = None + """The event_id of the client command, when supplied.""" + + +class TransportDtmfSent(BaseModel): """A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command. @@ -78,7 +94,7 @@ class TransportDtmfSend(BaseModel): event_id: str - type: Literal["transport.dtmf.send"] + type: Literal["transport.dtmf.sent"] client_event_id: Optional[str] = None """The event_id of the client command, when supplied.""" @@ -166,6 +182,7 @@ class TransportFailed(BaseModel): InfoEvent, TransportDtmfReceived, TransportDtmfSend, + TransportDtmfSent, TransportRinging, TransportAnswered, TransportFailed, diff --git a/src/openai/types/live/server_event.py b/src/openai/types/live/server_event.py index 26dc6a3604..0c9d2b3b6c 100644 --- a/src/openai/types/live/server_event.py +++ b/src/openai/types/live/server_event.py @@ -32,6 +32,7 @@ "SessionInputAudioAppend", "TransportDtmfReceived", "TransportDtmfSend", + "TransportDtmfSent", "TransportRinging", "TransportAnswered", "TransportFailed", @@ -69,6 +70,21 @@ class TransportDtmfReceived(BaseModel): class TransportDtmfSend(BaseModel): + """ + Legacy SIP DTMF delivery notification retained for SDK compatibility and saved events. Current servers confirm delivery with transport.dtmf.sent; transport.dtmf.send is now the client command. + """ + + event: str + + event_id: str + + type: Literal["transport.dtmf.send"] + + client_event_id: Optional[str] = None + """The event_id of the client command, when supplied.""" + + +class TransportDtmfSent(BaseModel): """A SIP DTMF keypress successfully sent to the SIP trunk. Delivered only to sideband observers; this is not a client command. @@ -78,7 +94,7 @@ class TransportDtmfSend(BaseModel): event_id: str - type: Literal["transport.dtmf.send"] + type: Literal["transport.dtmf.sent"] client_event_id: Optional[str] = None """The event_id of the client command, when supplied.""" @@ -166,6 +182,7 @@ class TransportFailed(BaseModel): InfoEvent, TransportDtmfReceived, TransportDtmfSend, + TransportDtmfSent, TransportRinging, TransportAnswered, TransportFailed,