Skip to content

Voice

8 types. Import any of them from opencode.types.

VoiceSessionResponse

data instance-attribute

VoiceSessionResponseData

transport instance-attribute

transport: VoiceTransport

VoiceTransport module-attribute

VoiceTransport: TypeAlias = Annotated[
    Annotated[VoiceWebRTCTransport, Tag("webrtc")]
    | Annotated[VoiceWebSocketTransport, Tag("websocket")]
    | Annotated[UnknownVoiceTransport, Tag("__unknown__")],
    Discriminator(
        discriminator(
            "type", "type", ["webrtc", "websocket"]
        )
    ),
]

VoiceTransportInput module-attribute

VoiceTransportInput: TypeAlias = Annotated[
    Annotated[VoiceWebRTCTransportInput, Tag("webrtc")]
    | Annotated[
        VoiceWebSocketTransportInput, Tag("websocket")
    ]
    | Annotated[
        UnknownVoiceTransportInput, Tag("__unknown__")
    ],
    Discriminator(
        discriminator(
            "type", "type", ["webrtc", "websocket"]
        )
    ),
]

VoiceWebRTCTransport

type class-attribute instance-attribute

type: Literal['webrtc'] = 'webrtc'

sdp instance-attribute

sdp: str

VoiceWebRTCTransportInput

type class-attribute instance-attribute

type: Literal['webrtc'] = 'webrtc'

sdp instance-attribute

sdp: str

dcid class-attribute instance-attribute

dcid: (
    float
    | OpenEnum[Literal["Infinity", "-Infinity", "NaN"]]
    | None
) = None

VoiceWebSocketTransport

type class-attribute instance-attribute

type: Literal['websocket'] = 'websocket'

url instance-attribute

url: str

token instance-attribute

token: str

expires_at class-attribute instance-attribute

expires_at: (
    float
    | OpenEnum[Literal["Infinity", "-Infinity", "NaN"]]
) = Field(
    validation_alias="expiresAt",
    serialization_alias="expiresAt",
)

VoiceWebSocketTransportInput

type class-attribute instance-attribute

type: Literal['websocket'] = 'websocket'