diff --git a/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md b/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md index 5caa96a022d4..998900c81f18 100644 --- a/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md +++ b/sdk/voicelive/azure-ai-voicelive/CHANGELOG.md @@ -1,15 +1,44 @@ # Release History -## 1.3.0b2 (Unreleased) +## 1.3.0 (Unreleased) ### Features Added +- **Azure Realtime Native Voice Support**: Added `AzureRealtimeNativeVoice` and + `AzureRealtimeNativeVoiceName`, and expanded `voice` fields to accept Azure realtime native voices. +- **Input Text Streaming Support**: Added `ClientEventInputTextDelta` and `ClientEventInputTextDone` + for incrementally streaming text input into existing conversation items. +- **Hosted Agent Invocation Input**: Added `invoke_input` to `ResponseCreateParams` and + `ServerEventResponseInvocationDelta` for hosted agent invocation passthrough data. +- **Echo Cancellation Configuration**: Added `EchoCancellationReferenceSource` and new + `reference_source` / `channels` options on `AudioEchoCancellation` to support both the default + server loopback reference path and client-provided stereo echo reference input. +- **Parallel Tool Call Control**: Added `parallel_tool_calls` to session models so callers can + control whether tool calls may run in parallel. +- **Session Expiration**: Added `expires_at` to `ResponseSession`, a server-set `datetime` indicating + when the session expires. + ### Breaking Changes +- **Default API Version Update**: Changed the SDK default API version from `2026-06-01-preview` to + the GA version `2026-07-15`. Pass `api_version="2026-06-01-preview"` explicitly to keep the previous + default behavior. + ### Bugs Fixed +- **Image Input Field Rename**: Renamed `RequestImageContentPart.url` to `image_url`. Update + image input construction to use `image_url=` instead of `url=`. + ### Other Changes +- **Removed Preview Features**: The following features introduced in `1.3.0b1` are not part of the GA + release and have been removed: + - **WebRTC Call Negotiation Support**: Removed `ClientEventRtcCallSdpCreate`, + `ServerEventRtcCallSdpCreated`, `ServerEventRtcCallError`, and `RtcCallErrorDetails`. + - **Audio Playback Lifecycle Events**: Removed `ServerEventOutputAudioBufferStarted` and + `ServerEventOutputAudioBufferStopped`. + - **Smart End-of-Turn Detection**: Removed `SmartEndOfTurnDetection`. + ## 1.3.0b1 (2026-05-28) ### Features Added diff --git a/sdk/voicelive/azure-ai-voicelive/_metadata.json b/sdk/voicelive/azure-ai-voicelive/_metadata.json index 312af8013e92..13d955e1bd07 100644 --- a/sdk/voicelive/azure-ai-voicelive/_metadata.json +++ b/sdk/voicelive/azure-ai-voicelive/_metadata.json @@ -1,6 +1,6 @@ { - "apiVersion": "2026-06-01-preview", + "apiVersion": "2026-07-15", "apiVersions": { - "VoiceLive": "2026-06-01-preview" + "VoiceLive": "2026-07-15" } } \ No newline at end of file diff --git a/sdk/voicelive/azure-ai-voicelive/api.md b/sdk/voicelive/azure-ai-voicelive/api.md new file mode 100644 index 000000000000..3a24cd938135 --- /dev/null +++ b/sdk/voicelive/azure-ai-voicelive/api.md @@ -0,0 +1,3909 @@ +```py +namespace azure.ai.voicelive.aio + + @overload + def azure.ai.voicelive.aio.connect( + *, + api_version: str = "2026-07-15", + connection_options: Optional[WebsocketConnectionOptions] = ..., + credential: Union[AzureKeyCredential, AsyncTokenCredential], + credential_scopes: Optional[Union[str, Sequence[str]]] = ..., + endpoint: str, + headers: Optional[Mapping[str, Any]] = ..., + model: Optional[str] = ..., + query: Optional[Mapping[str, Any]] = ... + ) -> AbstractAsyncContextManager[VoiceLiveConnection]: ... + + + @overload + def azure.ai.voicelive.aio.connect( + *, + agent_name: str, + agent_version: Optional[str] = ..., + api_version: str = "2026-07-15", + authentication_identity_client_id: Optional[str] = ..., + connection_options: Optional[WebsocketConnectionOptions] = ..., + conversation_id: Optional[str] = ..., + credential: Union[AzureKeyCredential, AsyncTokenCredential], + credential_scopes: Optional[Union[str, Sequence[str]]] = ..., + endpoint: str, + foundry_resource_override: Optional[str] = ..., + headers: Optional[Mapping[str, Any]] = ..., + model: Optional[str] = ..., + project_name: str, + query: Optional[Mapping[str, Any]] = ... + ) -> AbstractAsyncContextManager[VoiceLiveConnection]: ... + + + class azure.ai.voicelive.aio.ConnectionClosed(ConnectionError): + + def __init__( + self, + code: int, + reason: str + ) -> None: ... + + + class azure.ai.voicelive.aio.ConnectionError(AzureError): + + + class azure.ai.voicelive.aio.ConversationItemResource: + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + async def create( + self, + *, + event_id: Optional[str] = ..., + item: Union[ConversationRequestItem, Mapping[str, Any]], + previous_item_id: Optional[str] = ... + ) -> None: ... + + async def delete( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + async def retrieve( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + async def truncate( + self, + *, + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + + class azure.ai.voicelive.aio.ConversationResource: + item: ConversationItemResource + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + + class azure.ai.voicelive.aio.InputAudioBufferResource: + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + async def append( + self, + *, + audio: str, + event_id: Optional[str] = ... + ) -> None: ... + + async def clear( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + async def commit( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + + class azure.ai.voicelive.aio.OutputAudioBufferResource: + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + async def clear( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + + class azure.ai.voicelive.aio.ResponseResource: + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + async def cancel( + self, + *, + event_id: Optional[str] = ..., + response_id: Optional[str] = ... + ) -> None: ... + + async def create( + self, + *, + additional_instructions: Optional[str] = ..., + event_id: Optional[str] = ..., + response: Optional[Union[ResponseCreateParams, Mapping[str, Any]]] = ... + ) -> None: ... + + + class azure.ai.voicelive.aio.SessionResource: + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + async def update( + self, + *, + event_id: Optional[str] = ..., + session: Union[Mapping[str, Any], RequestSession] + ) -> None: ... + + + class azure.ai.voicelive.aio.TranscriptionSessionResource: + + def __init__(self, connection: VoiceLiveConnection) -> None: ... + + async def update( + self, + *, + event_id: Optional[str] = ..., + session: Mapping[str, Any] + ) -> None: ... + + + class azure.ai.voicelive.aio.VoiceLiveConnection: + conversation: ConversationResource + input_audio_buffer: InputAudioBufferResource + output_audio_buffer: OutputAudioBufferResource + response: ResponseResource + session: SessionResource + transcription_session: TranscriptionSessionResource + + async def __aiter__(self) -> AsyncIterator[ServerEvent]: ... + + def __init__( + self, + client_session: ClientSession, + ws: ClientWebSocketResponse + ) -> None: ... + + async def close( + self, + *, + code: int = 1000, + reason: str = "" + ) -> None: ... + + async def recv(self) -> ServerEvent: ... + + async def recv_bytes(self) -> bytes: ... + + async def send(self, event: Union[Mapping[str, Any], ClientEvent]) -> None: ... + + + class azure.ai.voicelive.aio.WebsocketConnectionOptions(TypedDict, total=False): + key "autoclose": NotRequired[bool] + key "autoping": NotRequired[bool] + key "close_timeout": NotRequired[float] + key "compression": NotRequired[Union[bool, int]] + key "handshake_timeout": NotRequired[float] + key "heartbeat": NotRequired[float] + key "max_msg_size": NotRequired[int] + key "receive_timeout": NotRequired[float] + key "vendor_options": NotRequired[Mapping[str, Any]] + + +namespace azure.ai.voicelive.models + + class azure.ai.voicelive.models.ActionFind(_Model): + pattern: str + type: Literal["find"] + url: str + + @overload + def __init__( + self, + *, + pattern: str, + url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ActionOpenPage(_Model): + type: Literal["open_page"] + url: str + + @overload + def __init__( + self, + *, + url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ActionSearch(_Model): + query: Optional[str] + sources: Optional[list[ActionSearchSource]] + type: Literal["search"] + + @overload + def __init__( + self, + *, + query: Optional[str] = ..., + sources: Optional[list[ActionSearchSource]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ActionSearchSource(_Model): + type: Literal["url"] + url: str + + @overload + def __init__( + self, + *, + url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AgentConfig(_Model): + agent_id: str + description: Optional[str] + name: str + thread_id: str + type: Literal["agent"] + + @overload + def __init__( + self, + *, + agent_id: str, + description: Optional[str] = ..., + name: str, + thread_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.Animation(_Model): + model_name: Optional[str] + outputs: Optional[list[Union[str, AnimationOutputType]]] + + @overload + def __init__( + self, + *, + model_name: Optional[str] = ..., + outputs: Optional[list[Union[str, AnimationOutputType]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BLENDSHAPES = "blendshapes" + VISEME_ID = "viseme_id" + + + class azure.ai.voicelive.models.AssistantMessageItem(MessageItem, discriminator='assistant'): + content: list[MessageContentPart] + id: str + role: Literal[MessageRole.ASSISTANT] + status: Union[str, ItemParamStatus] + type: Union[str, azure.ai.voicelive.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[MessageContentPart], + id: Optional[str] = ..., + status: Optional[Union[str, ItemParamStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AudioEchoCancellation(_Model): + channels: Optional[int] + reference_source: Optional[Union[str, EchoCancellationReferenceSource]] + type: Literal["server_echo_cancellation"] + + @overload + def __init__( + self, + *, + channels: Optional[int] = ..., + reference_source: Optional[Union[str, EchoCancellationReferenceSource]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AudioInputTranscriptionOptions(_Model): + custom_speech: Optional[dict[str, str]] + language: Optional[str] + model: Union[Literal["whisper-1"], Literal["gpt-4o-transcribe"], Literal["gpt-4o-mini-transcribe"], Literal["gpt-4o-transcribe-diarize"], Literal["mai-transcribe-1"], Literal["azure-speech"], str] + phrase_list: Optional[list[str]] + + @overload + def __init__( + self, + *, + custom_speech: Optional[dict[str, str]] = ..., + language: Optional[str] = ..., + model: Union[Literal[whisper-1], Literal[gpt-4o-transcribe], Literal[gpt-4o-mini-transcribe], Literal[gpt-4o-transcribe-diarize], Literal[mai-transcribe-1], Literal[azure-speech], str], + phrase_list: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AudioNoiseReduction(_Model): + type: Union[Literal["azure_deep_noise_suppression"], Literal["near_field"], Literal["far_field"], str] + + @overload + def __init__( + self, + *, + type: Union[Literal[azure_deep_noise_suppression], Literal[near_field], Literal[far_field], str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WORD = "word" + + + class azure.ai.voicelive.models.AvatarConfig(_Model): + avatar_type: Optional[Union[str, AvatarConfigTypes]] + character: str + customized: bool + ice_servers: Optional[list[IceServer]] + model: Optional[Union[str, PhotoAvatarBaseModes]] + output_audit_audio: Optional[bool] + output_protocol: Optional[Union[str, AvatarOutputProtocol]] + scene: Optional[Scene] + style: Optional[str] + video: Optional[VideoParams] + + @overload + def __init__( + self, + *, + avatar_type: Optional[Union[str, AvatarConfigTypes]] = ..., + character: str, + customized: bool, + ice_servers: Optional[list[IceServer]] = ..., + model: Optional[Union[str, PhotoAvatarBaseModes]] = ..., + output_audit_audio: Optional[bool] = ..., + output_protocol: Optional[Union[str, AvatarOutputProtocol]] = ..., + scene: Optional[Scene] = ..., + style: Optional[str] = ..., + video: Optional[VideoParams] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AvatarConfigTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PHOTO_AVATAR = "photo-avatar" + VIDEO_AVATAR = "video-avatar" + + + class azure.ai.voicelive.models.AvatarOutputProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): + WEBRTC = "webrtc" + WEBSOCKET = "websocket" + + + class azure.ai.voicelive.models.AzureAvatarVoiceSyncVoice(AzureVoice, discriminator='avatar-voice-sync'): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + locale: Optional[str] + model: Union[str, PersonalVoiceModels] + pitch: Optional[str] + prefer_locales: Optional[list[str]] + rate: Optional[str] + style: Optional[str] + temperature: Optional[float] + type: Literal[AzureVoiceType.AVATAR_VOICE_SYNC] + volume: Optional[str] + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + model: Union[str, PersonalVoiceModels], + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureCustomVoice(AzureVoice, discriminator='azure-custom'): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + endpoint_id: str + locale: Optional[str] + name: str + pitch: Optional[str] + prefer_locales: Optional[list[str]] + rate: Optional[str] + style: Optional[str] + temperature: Optional[float] + type: Literal[AzureVoiceType.AZURE_CUSTOM] + volume: Optional[str] + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + endpoint_id: str, + locale: Optional[str] = ..., + name: str, + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzurePersonalVoice(AzureVoice, discriminator='azure-personal'): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + locale: Optional[str] + model: Union[str, PersonalVoiceModels] + name: str + pitch: Optional[str] + prefer_locales: Optional[list[str]] + rate: Optional[str] + style: Optional[str] + temperature: Optional[float] + type: Literal[AzureVoiceType.AZURE_PERSONAL] + volume: Optional[str] + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + model: Union[str, PersonalVoiceModels], + name: str, + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureRealtimeNativeVoice(_Model): + name: Union[str, AzureRealtimeNativeVoiceName] + type: Literal["azure-realtime-native"] + + @overload + def __init__( + self, + *, + name: Union[str, AzureRealtimeNativeVoiceName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureRealtimeNativeVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AARTI = "aarti" + ANDREW = "andrew" + AVA = "ava" + DENISE = "denise" + DIYA = "diya" + ELSA = "elsa" + FLORIAN = "florian" + FRANCISCA = "francisca" + MEERA = "meera" + XIAOXIAO = "xiaoxiao" + XIMENA = "ximena" + YUNXI = "yunxi" + + + class azure.ai.voicelive.models.AzureSemanticDetection(EouDetection, discriminator='semantic_detection_v1'): + model: Literal["semantic_detection_v1"] + threshold_level: Optional[Union[str, EouThresholdLevel]] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, EouThresholdLevel]] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureSemanticDetectionEn(EouDetection, discriminator='semantic_detection_v1_en'): + model: Literal["semantic_detection_v1_en"] + threshold_level: Optional[Union[str, EouThresholdLevel]] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, EouThresholdLevel]] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureSemanticDetectionMultilingual(EouDetection, discriminator='semantic_detection_v1_multilingual'): + model: Literal["semantic_detection_v1_multilingual"] + threshold_level: Optional[Union[str, EouThresholdLevel]] + timeout_ms: Optional[int] + + @overload + def __init__( + self, + *, + threshold_level: Optional[Union[str, EouThresholdLevel]] = ..., + timeout_ms: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureSemanticVad(TurnDetection, discriminator='azure_semantic_vad'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[EouDetection] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[TurnDetectionType.AZURE_SEMANTIC_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[EouDetection] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureSemanticVadEn(TurnDetection, discriminator='azure_semantic_vad_en'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[EouDetection] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[TurnDetectionType.AZURE_SEMANTIC_VAD_EN] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[EouDetection] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureSemanticVadMultilingual(TurnDetection, discriminator='azure_semantic_vad_multilingual'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[EouDetection] + interrupt_response: Optional[bool] + languages: Optional[list[str]] + prefix_padding_ms: Optional[int] + remove_filler_words: Optional[bool] + silence_duration_ms: Optional[int] + speech_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[TurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[EouDetection] = ..., + interrupt_response: Optional[bool] = ..., + languages: Optional[list[str]] = ..., + prefix_padding_ms: Optional[int] = ..., + remove_filler_words: Optional[bool] = ..., + silence_duration_ms: Optional[int] = ..., + speech_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureStandardVoice(AzureVoice, discriminator='azure-standard'): + custom_lexicon_url: Optional[str] + custom_text_normalization_url: Optional[str] + locale: Optional[str] + name: str + pitch: Optional[str] + prefer_locales: Optional[list[str]] + rate: Optional[str] + style: Optional[str] + temperature: Optional[float] + type: Literal[AzureVoiceType.AZURE_STANDARD] + volume: Optional[str] + + @overload + def __init__( + self, + *, + custom_lexicon_url: Optional[str] = ..., + custom_text_normalization_url: Optional[str] = ..., + locale: Optional[str] = ..., + name: str, + pitch: Optional[str] = ..., + prefer_locales: Optional[list[str]] = ..., + rate: Optional[str] = ..., + style: Optional[str] = ..., + temperature: Optional[float] = ..., + volume: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureVoice(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVATAR_VOICE_SYNC = "avatar-voice-sync" + AZURE_CUSTOM = "azure-custom" + AZURE_PERSONAL = "azure-personal" + AZURE_STANDARD = "azure-standard" + + + class azure.ai.voicelive.models.Background(_Model): + color: Optional[str] + image_url: Optional[str] + + @overload + def __init__( + self, + *, + color: Optional[str] = ..., + image_url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.CachedTokenDetails(_Model): + audio_tokens: int + image_tokens: int + text_tokens: int + + @overload + def __init__( + self, + *, + audio_tokens: int, + image_tokens: int, + text_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEvent(_Model): + event_id: Optional[str] + type: str + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventConversationItemCreate(ClientEvent, discriminator='conversation.item.create'): + event_id: str + item: Optional[ConversationRequestItem] + previous_item_id: Optional[str] + type: Literal[ClientEventType.CONVERSATION_ITEM_CREATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: Optional[ConversationRequestItem] = ..., + previous_item_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventConversationItemDelete(ClientEvent, discriminator='conversation.item.delete'): + event_id: str + item_id: str + type: Literal[ClientEventType.CONVERSATION_ITEM_DELETE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventConversationItemRetrieve(ClientEvent, discriminator='conversation.item.retrieve'): + event_id: str + item_id: str + type: Literal[ClientEventType.CONVERSATION_ITEM_RETRIEVE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventConversationItemTruncate(ClientEvent, discriminator='conversation.item.truncate'): + audio_end_ms: int + content_index: int + event_id: str + item_id: str + type: Literal[ClientEventType.CONVERSATION_ITEM_TRUNCATE] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioBufferAppend(ClientEvent, discriminator='input_audio_buffer.append'): + audio: str + event_id: str + type: Literal[ClientEventType.INPUT_AUDIO_BUFFER_APPEND] + + @overload + def __init__( + self, + *, + audio: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioBufferClear(ClientEvent, discriminator='input_audio_buffer.clear'): + event_id: str + type: Literal[ClientEventType.INPUT_AUDIO_BUFFER_CLEAR] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioBufferCommit(ClientEvent, discriminator='input_audio_buffer.commit'): + event_id: str + type: Literal[ClientEventType.INPUT_AUDIO_BUFFER_COMMIT] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioClear(ClientEvent, discriminator='input_audio.clear'): + event_id: str + type: Literal[ClientEventType.INPUT_AUDIO_CLEAR] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioTurnAppend(ClientEvent, discriminator='input_audio.turn.append'): + audio: str + event_id: str + turn_id: str + type: Literal[ClientEventType.INPUT_AUDIO_TURN_APPEND] + + @overload + def __init__( + self, + *, + audio: str, + event_id: Optional[str] = ..., + turn_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioTurnCancel(ClientEvent, discriminator='input_audio.turn.cancel'): + event_id: str + turn_id: str + type: Literal[ClientEventType.INPUT_AUDIO_TURN_CANCEL] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + turn_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioTurnEnd(ClientEvent, discriminator='input_audio.turn.end'): + event_id: str + turn_id: str + type: Literal[ClientEventType.INPUT_AUDIO_TURN_END] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + turn_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputAudioTurnStart(ClientEvent, discriminator='input_audio.turn.start'): + event_id: str + turn_id: str + type: Literal[ClientEventType.INPUT_AUDIO_TURN_START] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + turn_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputTextDelta(ClientEvent, discriminator='input_text.delta'): + content_index: Optional[int] + delta: str + event_id: str + id: str + type: Literal[ClientEventType.INPUT_TEXT_DELTA] + + @overload + def __init__( + self, + *, + content_index: Optional[int] = ..., + delta: str, + event_id: Optional[str] = ..., + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventInputTextDone(ClientEvent, discriminator='input_text.done'): + content_index: Optional[int] + event_id: str + id: str + type: Literal[ClientEventType.INPUT_TEXT_DONE] + + @overload + def __init__( + self, + *, + content_index: Optional[int] = ..., + event_id: Optional[str] = ..., + id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventOutputAudioBufferClear(ClientEvent, discriminator='output_audio_buffer.clear'): + event_id: str + type: Literal[ClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventResponseCancel(ClientEvent, discriminator='response.cancel'): + event_id: str + response_id: Optional[str] + type: Literal[ClientEventType.RESPONSE_CANCEL] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + response_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventResponseCreate(ClientEvent, discriminator='response.create'): + additional_instructions: Optional[str] + event_id: str + response: Optional[ResponseCreateParams] + type: Literal[ClientEventType.RESPONSE_CREATE] + + @overload + def __init__( + self, + *, + additional_instructions: Optional[str] = ..., + event_id: Optional[str] = ..., + response: Optional[ResponseCreateParams] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventSessionAvatarConnect(ClientEvent, discriminator='session.avatar.connect'): + client_sdp: str + event_id: str + type: Literal[ClientEventType.SESSION_AVATAR_CONNECT] + + @overload + def __init__( + self, + *, + client_sdp: str, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventSessionUpdate(ClientEvent, discriminator='session.update'): + event_id: str + session: RequestSession + type: Literal[ClientEventType.SESSION_UPDATE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: RequestSession + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATE = "conversation.item.create" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + INPUT_AUDIO_CLEAR = "input_audio.clear" + INPUT_AUDIO_TURN_APPEND = "input_audio.turn.append" + INPUT_AUDIO_TURN_CANCEL = "input_audio.turn.cancel" + INPUT_AUDIO_TURN_END = "input_audio.turn.end" + INPUT_AUDIO_TURN_START = "input_audio.turn.start" + INPUT_TEXT_DELTA = "input_text.delta" + INPUT_TEXT_DONE = "input_text.done" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + RESPONSE_CANCEL = "response.cancel" + RESPONSE_CREATE = "response.create" + SESSION_AVATAR_CONNECT = "session.avatar.connect" + SESSION_UPDATE = "session.update" + + + class azure.ai.voicelive.models.ContentPart(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ContentPartType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUDIO = "audio" + INPUT_AUDIO = "input_audio" + INPUT_IMAGE = "input_image" + INPUT_TEXT = "input_text" + TEXT = "text" + + + class azure.ai.voicelive.models.ConversationItemBase(_Model): + + + class azure.ai.voicelive.models.ConversationRequestItem(_Model): + id: Optional[str] + type: str + + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.EchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT = "client" + SERVER = "server" + + + class azure.ai.voicelive.models.EouDetection(_Model): + model: str + + @overload + def __init__( + self, + *, + model: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.EouThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DEFAULT = "default" + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + + + class azure.ai.voicelive.models.ErrorResponse(_Model): + error: VoiceLiveErrorDetails + + @overload + def __init__( + self, + *, + error: VoiceLiveErrorDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.FileSearchResult(_Model): + attributes: Optional[dict[str, str]] + file_id: Optional[str] + filename: Optional[str] + score: Optional[float] + text: Optional[str] + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, str]] = ..., + file_id: Optional[str] = ..., + filename: Optional[str] = ..., + score: Optional[float] = ..., + text: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.FunctionCallItem(ConversationRequestItem, discriminator='function_call'): + arguments: str + call_id: str + id: str + name: str + status: Optional[Union[str, ItemParamStatus]] + type: Literal[ItemType.FUNCTION_CALL] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: str, + id: Optional[str] = ..., + name: str, + status: Optional[Union[str, ItemParamStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.FunctionCallOutputItem(ConversationRequestItem, discriminator='function_call_output'): + call_id: str + id: str + output: str + status: Optional[Union[str, ItemParamStatus]] + type: Literal[ItemType.FUNCTION_CALL_OUTPUT] + + @overload + def __init__( + self, + *, + call_id: str, + id: Optional[str] = ..., + output: str, + status: Optional[Union[str, ItemParamStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.FunctionTool(Tool, discriminator='function'): + description: Optional[str] + name: str + parameters: Optional[Any] + type: Literal[ToolType.FUNCTION] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + name: str, + parameters: Optional[Any] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.IceServer(_Model): + credential: Optional[str] + urls: list[str] + username: Optional[str] + + @overload + def __init__( + self, + *, + credential: Optional[str] = ..., + urls: list[str], + username: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.InputAudioContentPart(MessageContentPart, discriminator='input_audio'): + audio: str + transcript: Optional[str] + type: Literal[ContentPartType.INPUT_AUDIO] + + @overload + def __init__( + self, + *, + audio: str, + transcript: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.InputAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + G711_ALAW = "g711_alaw" + G711_ULAW = "g711_ulaw" + PCM16 = "pcm16" + + + class azure.ai.voicelive.models.InputTextContentPart(MessageContentPart, discriminator='input_text'): + text: str + type: Literal[ContentPartType.INPUT_TEXT] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.InputTokenDetails(_Model): + audio_tokens: int + cached_tokens: int + cached_tokens_details: CachedTokenDetails + image_tokens: int + text_tokens: int + + @overload + def __init__( + self, + *, + audio_tokens: int, + cached_tokens: int, + cached_tokens_details: CachedTokenDetails, + image_tokens: int, + text_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.InterimResponseConfigBase(_Model): + latency_threshold_ms: Optional[int] + triggers: Optional[list[Union[str, InterimResponseTrigger]]] + type: str + + @overload + def __init__( + self, + *, + latency_threshold_ms: Optional[int] = ..., + triggers: Optional[list[Union[str, InterimResponseTrigger]]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.InterimResponseConfigType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LLM_INTERIM_RESPONSE = "llm_interim_response" + STATIC_INTERIM_RESPONSE = "static_interim_response" + + + class azure.ai.voicelive.models.InterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LATENCY = "latency" + TOOL = "tool" + + + class azure.ai.voicelive.models.ItemParamStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + INCOMPLETE = "incomplete" + + + class azure.ai.voicelive.models.ItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_SEARCH_CALL = "file_search_call" + FUNCTION_CALL = "function_call" + FUNCTION_CALL_OUTPUT = "function_call_output" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + MCP_CALL = "mcp_call" + MCP_LIST_TOOLS = "mcp_list_tools" + MESSAGE = "message" + WEB_SEARCH_CALL = "web_search_call" + + + class azure.ai.voicelive.models.LlmInterimResponseConfig(InterimResponseConfigBase, discriminator='llm_interim_response'): + instructions: Optional[str] + latency_threshold_ms: int + max_completion_tokens: Optional[int] + model: Optional[str] + triggers: Union[list[str, InterimResponseTrigger]] + type: Literal[InterimResponseConfigType.LLM_INTERIM_RESPONSE] + + @overload + def __init__( + self, + *, + instructions: Optional[str] = ..., + latency_threshold_ms: Optional[int] = ..., + max_completion_tokens: Optional[int] = ..., + model: Optional[str] = ..., + triggers: Optional[list[Union[str, InterimResponseTrigger]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.LogProbProperties(_Model): + bytes: list[int] + logprob: float + token: str + + @overload + def __init__( + self, + *, + bytes: list[int], + logprob: float, + token: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.MCPApprovalResponseRequestItem(ConversationRequestItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + id: str + type: Literal[ItemType.MCP_APPROVAL_RESPONSE] + + @overload + def __init__( + self, + *, + approval_request_id: str, + approve: bool, + id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.MCPApprovalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALWAYS = "always" + NEVER = "never" + + + class azure.ai.voicelive.models.MCPServer(Tool, discriminator='mcp'): + allowed_tools: Optional[list[str]] + authorization: Optional[str] + headers: Optional[dict[str, str]] + require_approval: Optional[Union[str, MCPApprovalType, dict[str, list[str]]]] + server_label: str + server_url: str + type: Literal[ToolType.MCP] + + @overload + def __init__( + self, + *, + allowed_tools: Optional[list[str]] = ..., + authorization: Optional[str] = ..., + headers: Optional[dict[str, str]] = ..., + require_approval: Optional[Union[str, MCPApprovalType, dict[str, list[str]]]] = ..., + server_label: str, + server_url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.MCPTool(_Model): + annotations: Optional[Any] + description: Optional[str] + input_schema: Any + name: str + + @overload + def __init__( + self, + *, + annotations: Optional[Any] = ..., + description: Optional[str] = ..., + input_schema: Any, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.MessageContentPart(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.MessageItem(ConversationRequestItem, discriminator='message'): + content: list[MessageContentPart] + id: str + role: str + status: Optional[Union[str, ItemParamStatus]] + type: Literal[ItemType.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[MessageContentPart], + id: Optional[str] = ..., + role: str, + status: Optional[Union[str, ItemParamStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.MessageRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ASSISTANT = "assistant" + SYSTEM = "system" + USER = "user" + + + class azure.ai.voicelive.models.Modality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANIMATION = "animation" + AUDIO = "audio" + AVATAR = "avatar" + TEXT = "text" + + + class azure.ai.voicelive.models.OpenAIVoice(_Model): + name: Union[str, OpenAIVoiceName] + type: Literal["openai"] + + @overload + def __init__( + self, + *, + name: Union[str, OpenAIVoiceName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.OpenAIVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ALLOY = "alloy" + ASH = "ash" + BALLAD = "ballad" + CEDAR = "cedar" + CORAL = "coral" + ECHO = "echo" + MARIN = "marin" + SAGE = "sage" + SHIMMER = "shimmer" + VERSE = "verse" + + + class azure.ai.voicelive.models.OutputAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + G711_ALAW = "g711_alaw" + G711_ULAW = "g711_ulaw" + PCM16 = "pcm16" + PCM16_16000_HZ = "pcm16_16000hz" + PCM16_8000_HZ = "pcm16_8000hz" + + + class azure.ai.voicelive.models.OutputTextContentPart(MessageContentPart, discriminator='text'): + text: str + type: Literal[ContentPartType.TEXT] + + @overload + def __init__( + self, + *, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.OutputTokenDetails(_Model): + audio_tokens: int + reasoning_tokens: Optional[int] + text_tokens: int + + @overload + def __init__( + self, + *, + audio_tokens: int, + reasoning_tokens: Optional[int] = ..., + text_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.PersonalVoiceModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DRAGON_HD_OMNI_LATEST_NEURAL = "DragonHDOmniLatestNeural" + DRAGON_LATEST_NEURAL = "DragonLatestNeural" + MAI_VOICE1 = "MAI-Voice-1" + PHOENIX_LATEST_NEURAL = "PhoenixLatestNeural" + PHOENIX_V2_NEURAL = "PhoenixV2Neural" + + + class azure.ai.voicelive.models.PhotoAvatarBaseModes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + VASA1 = "vasa-1" + + + class azure.ai.voicelive.models.ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + HIGH = "high" + LOW = "low" + MEDIUM = "medium" + MINIMAL = "minimal" + NONE = "none" + XHIGH = "xhigh" + + + class azure.ai.voicelive.models.RequestAudioContentPart(ContentPart, discriminator='input_audio'): + audio: str + transcript: Optional[str] + type: Literal[ContentPartType.INPUT_AUDIO] + + @overload + def __init__( + self, + *, + audio: str, + transcript: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.RequestImageContentPart(ContentPart, discriminator='input_image'): + detail: Optional[Union[str, RequestImageContentPartDetail]] + image_url: Optional[str] + type: Literal[ContentPartType.INPUT_IMAGE] + + @overload + def __init__( + self, + *, + detail: Optional[Union[str, RequestImageContentPartDetail]] = ..., + image_url: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.RequestImageContentPartDetail(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + HIGH = "high" + LOW = "low" + + + class azure.ai.voicelive.models.RequestSession(GeneratedRequestSession): + + def __init__( + self, + *args: Any, + **kwargs: Any + ) -> None: ... + + def as_dict(self, **kwargs: Any) -> dict[str, Any]: ... + + + class azure.ai.voicelive.models.RequestTextContentPart(ContentPart, discriminator='input_text'): + text: Optional[str] + type: Literal[ContentPartType.INPUT_TEXT] + + @overload + def __init__( + self, + *, + text: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.Response(_Model): + conversation_id: Optional[str] + id: Optional[str] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[dict[str, str]] + modalities: Optional[list[Union[str, Modality]]] + object: Optional[Literal["response"]] + output: Optional[list[ResponseItem]] + output_audio_format: Optional[Union[str, OutputAudioFormat]] + status: Optional[Union[str, ResponseStatus]] + status_details: Optional[ResponseStatusDetails] + temperature: Optional[float] + usage: Optional[TokenUsage] + voice: Optional[Voice] + + @overload + def __init__( + self, + *, + conversation_id: Optional[str] = ..., + id: Optional[str] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[dict[str, str]] = ..., + modalities: Optional[list[Union[str, Modality]]] = ..., + object: Optional[Literal[response]] = ..., + output: Optional[list[ResponseItem]] = ..., + output_audio_format: Optional[Union[str, OutputAudioFormat]] = ..., + status: Optional[Union[str, ResponseStatus]] = ..., + status_details: Optional[ResponseStatusDetails] = ..., + temperature: Optional[float] = ..., + usage: Optional[TokenUsage] = ..., + voice: Optional[Voice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseAudioContentPart(ContentPart, discriminator='audio'): + transcript: Optional[str] + type: Literal[ContentPartType.AUDIO] + + @overload + def __init__( + self, + *, + transcript: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseCancelledDetails(ResponseStatusDetails, discriminator='cancelled'): + reason: Union[Literal["turn_detected"], Literal["client_cancelled"], str] + type: Literal[ResponseStatus.CANCELLED] + + @overload + def __init__( + self, + *, + reason: Union[Literal[turn_detected], Literal[client_cancelled], str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseCreateParams(_Model): + append_input_items: Optional[list[ConversationRequestItem]] + cancel_previous: Optional[bool] + commit: Optional[bool] + input_items: Optional[list[ConversationRequestItem]] + instructions: Optional[str] + interim_response: Optional[InterimResponseConfig] + invoke_input: Optional[dict[str, Any]] + max_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[dict[str, str]] + modalities: Optional[list[Union[str, Modality]]] + output_audio_format: Optional[Union[str, OutputAudioFormat]] + pre_generated_assistant_message: Optional[AssistantMessageItem] + reasoning_effort: Optional[Union[str, ReasoningEffort]] + temperature: Optional[float] + tool_choice: Optional[str] + tools: Optional[list[Tool]] + voice: Optional[Voice] + + @overload + def __init__( + self, + *, + append_input_items: Optional[list[ConversationRequestItem]] = ..., + cancel_previous: Optional[bool] = ..., + commit: Optional[bool] = ..., + input_items: Optional[list[ConversationRequestItem]] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[InterimResponseConfig] = ..., + invoke_input: Optional[dict[str, Any]] = ..., + max_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[dict[str, str]] = ..., + modalities: Optional[list[Union[str, Modality]]] = ..., + output_audio_format: Optional[Union[str, OutputAudioFormat]] = ..., + pre_generated_assistant_message: Optional[AssistantMessageItem] = ..., + reasoning_effort: Optional[Union[str, ReasoningEffort]] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[str] = ..., + tools: Optional[list[Tool]] = ..., + voice: Optional[Voice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseFailedDetails(ResponseStatusDetails, discriminator='failed'): + error: Any + type: Literal[ResponseStatus.FAILED] + + @overload + def __init__( + self, + *, + error: Any + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseFileSearchCallItem(ResponseItem, discriminator='file_search_call'): + id: str + object: str + queries: Optional[list[str]] + results: Optional[list[FileSearchResult]] + status: Union[Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], Literal["failed"], str] + type: Literal[ItemType.FILE_SEARCH_CALL] + + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + queries: Optional[list[str]] = ..., + results: Optional[list[FileSearchResult]] = ..., + status: Union[Literal[in_progress], Literal[searching], Literal[completed], Literal[incomplete], Literal[failed], str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseFunctionCallItem(ResponseItem, discriminator='function_call'): + arguments: str + call_id: str + id: str + name: str + object: str + status: Union[str, ResponseItemStatus] + type: Literal[ItemType.FUNCTION_CALL] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: str, + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + status: Union[str, ResponseItemStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseFunctionCallOutputItem(ResponseItem, discriminator='function_call_output'): + call_id: str + id: str + object: str + output: str + type: Literal[ItemType.FUNCTION_CALL_OUTPUT] + + @overload + def __init__( + self, + *, + call_id: str, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + output: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseIncompleteDetails(ResponseStatusDetails, discriminator='incomplete'): + reason: Union[Literal["max_output_tokens"], Literal["content_filter"], str] + type: Literal[ResponseStatus.INCOMPLETE] + + @overload + def __init__( + self, + *, + reason: Union[Literal[max_output_tokens], Literal[content_filter], str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseItem(_Model): + id: Optional[str] + object: Optional[Literal["item"]] + type: str + + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseItemStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "completed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" + + + class azure.ai.voicelive.models.ResponseMCPApprovalRequestItem(ResponseItem, discriminator='mcp_approval_request'): + arguments: Optional[str] + id: str + name: str + object: str + server_label: str + type: Literal[ItemType.MCP_APPROVAL_REQUEST] + + @overload + def __init__( + self, + *, + arguments: Optional[str] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseMCPApprovalResponseItem(ResponseItem, discriminator='mcp_approval_response'): + approval_request_id: str + approve: bool + id: str + object: str + reason: Optional[str] + type: Literal[ItemType.MCP_APPROVAL_RESPONSE] + + @overload + def __init__( + self, + *, + approval_request_id: str, + approve: bool, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + reason: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseMCPCallItem(ResponseItem, discriminator='mcp_call'): + approval_request_id: Optional[str] + arguments: str + error: Optional[Any] + id: str + name: str + object: str + output: Optional[str] + server_label: str + type: Literal[ItemType.MCP_CALL] + + @overload + def __init__( + self, + *, + approval_request_id: Optional[str] = ..., + arguments: str, + error: Optional[Any] = ..., + id: Optional[str] = ..., + name: str, + object: Optional[Literal[item]] = ..., + output: Optional[str] = ..., + server_label: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseMCPListToolItem(ResponseItem, discriminator='mcp_list_tools'): + id: str + object: str + server_label: str + tools: list[MCPTool] + type: Literal[ItemType.MCP_LIST_TOOLS] + + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + server_label: str, + tools: list[MCPTool] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseMessageItem(ResponseItem, discriminator='message'): + content: list[ContentPart] + id: str + object: str + role: Union[str, MessageRole] + status: Union[str, ResponseItemStatus] + type: Literal[ItemType.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[ContentPart], + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + role: Union[str, MessageRole], + status: Union[str, ResponseItemStatus] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseSession(_Model): + agent: Optional[AgentConfig] + animation: Optional[Animation] + avatar: Optional[AvatarConfig] + expires_at: Optional[datetime] + id: Optional[str] + include: Optional[list[Union[str, SessionIncludeOption]]] + input_audio_echo_cancellation: Optional[AudioEchoCancellation] + input_audio_format: Optional[Union[str, InputAudioFormat]] + input_audio_noise_reduction: Optional[AudioNoiseReduction] + input_audio_sampling_rate: Optional[int] + input_audio_transcription: Optional[AudioInputTranscriptionOptions] + instructions: Optional[str] + interim_response: Optional[InterimResponseConfig] + max_response_output_tokens: Optional[Union[int, Literal["inf"]]] + metadata: Optional[dict[str, str]] + modalities: Optional[list[Union[str, Modality]]] + model: Optional[str] + output_audio_format: Optional[Union[str, OutputAudioFormat]] + output_audio_timestamp_types: Optional[list[Union[str, AudioTimestampType]]] + parallel_tool_calls: Optional[bool] + reasoning_effort: Optional[Union[str, ReasoningEffort]] + temperature: Optional[float] + tool_choice: Optional[ToolChoice] + tools: Optional[list[Tool]] + turn_detection: Optional[TurnDetection] + voice: Optional[Voice] + + @overload + def __init__( + self, + *, + agent: Optional[AgentConfig] = ..., + animation: Optional[Animation] = ..., + avatar: Optional[AvatarConfig] = ..., + expires_at: Optional[datetime] = ..., + id: Optional[str] = ..., + include: Optional[list[Union[str, SessionIncludeOption]]] = ..., + input_audio_echo_cancellation: Optional[AudioEchoCancellation] = ..., + input_audio_format: Optional[Union[str, InputAudioFormat]] = ..., + input_audio_noise_reduction: Optional[AudioNoiseReduction] = ..., + input_audio_sampling_rate: Optional[int] = ..., + input_audio_transcription: Optional[AudioInputTranscriptionOptions] = ..., + instructions: Optional[str] = ..., + interim_response: Optional[InterimResponseConfig] = ..., + max_response_output_tokens: Optional[Union[int, Literal[inf]]] = ..., + metadata: Optional[dict[str, str]] = ..., + modalities: Optional[list[Union[str, Modality]]] = ..., + model: Optional[str] = ..., + output_audio_format: Optional[Union[str, OutputAudioFormat]] = ..., + output_audio_timestamp_types: Optional[list[Union[str, AudioTimestampType]]] = ..., + parallel_tool_calls: Optional[bool] = ..., + reasoning_effort: Optional[Union[str, ReasoningEffort]] = ..., + temperature: Optional[float] = ..., + tool_choice: Optional[ToolChoice] = ..., + tools: Optional[list[Tool]] = ..., + turn_detection: Optional[TurnDetection] = ..., + voice: Optional[Voice] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELLED = "cancelled" + COMPLETED = "completed" + FAILED = "failed" + INCOMPLETE = "incomplete" + IN_PROGRESS = "in_progress" + + + class azure.ai.voicelive.models.ResponseStatusDetails(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseTextContentPart(ContentPart, discriminator='text'): + text: Optional[str] + type: Literal[ContentPartType.TEXT] + + @overload + def __init__( + self, + *, + text: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ResponseWebSearchCallItem(ResponseItem, discriminator='web_search_call'): + id: str + object: str + status: Union[Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str] + type: Literal[ItemType.WEB_SEARCH_CALL] + + @overload + def __init__( + self, + *, + id: Optional[str] = ..., + object: Optional[Literal[item]] = ..., + status: Union[Literal[in_progress], Literal[searching], Literal[completed], Literal[failed], str] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.Scene(_Model): + amplitude: Optional[float] + position_x: Optional[float] + position_y: Optional[float] + rotation_x: Optional[float] + rotation_y: Optional[float] + rotation_z: Optional[float] + zoom: Optional[float] + + @overload + def __init__( + self, + *, + amplitude: Optional[float] = ..., + position_x: Optional[float] = ..., + position_y: Optional[float] = ..., + rotation_x: Optional[float] = ..., + rotation_y: Optional[float] = ..., + rotation_z: Optional[float] = ..., + zoom: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEvent(_Model): + event_id: Optional[str] + type: str + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemCreated(ServerEvent, discriminator='conversation.item.created'): + event_id: str + item: Optional[ResponseItem] + previous_item_id: Optional[str] + type: Literal[ServerEventType.CONVERSATION_ITEM_CREATED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: Optional[ResponseItem] = ..., + previous_item_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemDeleted(ServerEvent, discriminator='conversation.item.deleted'): + event_id: str + item_id: str + type: Literal[ServerEventType.CONVERSATION_ITEM_DELETED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemInputAudioTranscriptionCompleted(ServerEvent, discriminator='conversation.item.input_audio_transcription.completed'): + content_index: int + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + phrases: Optional[list[TranscriptionPhrase]] + transcript: str + type: Literal[ServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ..., + phrases: Optional[list[TranscriptionPhrase]] = ..., + transcript: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemInputAudioTranscriptionDelta(ServerEvent, discriminator='conversation.item.input_audio_transcription.delta'): + content_index: Optional[int] + delta: Optional[str] + event_id: str + item_id: str + logprobs: Optional[list[LogProbProperties]] + type: Literal[ServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] + + @overload + def __init__( + self, + *, + content_index: Optional[int] = ..., + delta: Optional[str] = ..., + event_id: Optional[str] = ..., + item_id: str, + logprobs: Optional[list[LogProbProperties]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemInputAudioTranscriptionFailed(ServerEvent, discriminator='conversation.item.input_audio_transcription.failed'): + content_index: int + error: VoiceLiveErrorDetails + event_id: str + item_id: str + type: Literal[ServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] + + @overload + def __init__( + self, + *, + content_index: int, + error: VoiceLiveErrorDetails, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemRetrieved(ServerEvent, discriminator='conversation.item.retrieved'): + event_id: str + item: Optional[ResponseItem] + type: Literal[ServerEventType.CONVERSATION_ITEM_RETRIEVED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: Optional[ResponseItem] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventConversationItemTruncated(ServerEvent, discriminator='conversation.item.truncated'): + audio_end_ms: int + content_index: int + event_id: str + item_id: str + type: Literal[ServerEventType.CONVERSATION_ITEM_TRUNCATED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventError(ServerEvent, discriminator='error'): + error: ServerEventErrorDetails + event_id: str + type: Literal[ServerEventType.ERROR] + + @overload + def __init__( + self, + *, + error: ServerEventErrorDetails, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventErrorDetails(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] + type: str + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventInputAudioBufferCleared(ServerEvent, discriminator='input_audio_buffer.cleared'): + event_id: str + type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventInputAudioBufferCommitted(ServerEvent, discriminator='input_audio_buffer.committed'): + event_id: str + item_id: str + previous_item_id: Optional[str] + type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + previous_item_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventInputAudioBufferSpeechStarted(ServerEvent, discriminator='input_audio_buffer.speech_started'): + audio_start_ms: int + event_id: str + item_id: str + type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] + + @overload + def __init__( + self, + *, + audio_start_ms: int, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventInputAudioBufferSpeechStopped(ServerEvent, discriminator='input_audio_buffer.speech_stopped'): + audio_end_ms: int + event_id: str + item_id: str + type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] + + @overload + def __init__( + self, + *, + audio_end_ms: int, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventMcpListToolsCompleted(ServerEvent, discriminator='mcp_list_tools.completed'): + event_id: str + item_id: str + type: Literal[ServerEventType.MCP_LIST_TOOLS_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventMcpListToolsFailed(ServerEvent, discriminator='mcp_list_tools.failed'): + event_id: str + item_id: str + type: Literal[ServerEventType.MCP_LIST_TOOLS_FAILED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventMcpListToolsInProgress(ServerEvent, discriminator='mcp_list_tools.in_progress'): + event_id: str + item_id: str + type: Literal[ServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventOutputAudioBufferCleared(ServerEvent, discriminator='output_audio_buffer.cleared'): + event_id: str + type: Literal[ServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAnimationBlendshapeDelta(ServerEvent, discriminator='response.animation_blendshapes.delta'): + content_index: int + event_id: str + frame_index: int + frames: Union[list[list[float]], str] + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + frame_index: int, + frames: Union[list[list[float]], str], + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAnimationBlendshapeDone(ServerEvent, discriminator='response.animation_blendshapes.done'): + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAnimationVisemeDelta(ServerEvent, discriminator='response.animation_viseme.delta'): + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_ANIMATION_VISEME_DELTA] + viseme_id: int + + @overload + def __init__( + self, + *, + audio_offset_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + viseme_id: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAnimationVisemeDone(ServerEvent, discriminator='response.animation_viseme.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_ANIMATION_VISEME_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioDelta(ServerEvent, discriminator='response.audio.delta'): + content_index: int + delta: bytes + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_AUDIO_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: bytes, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioDone(ServerEvent, discriminator='response.audio.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_AUDIO_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioTimestampDelta(ServerEvent, discriminator='response.audio_timestamp.delta'): + audio_duration_ms: int + audio_offset_ms: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + timestamp_type: Literal["word"] + type: Literal[ServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA] + + @overload + def __init__( + self, + *, + audio_duration_ms: int, + audio_offset_ms: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioTimestampDone(ServerEvent, discriminator='response.audio_timestamp.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_AUDIO_TIMESTAMP_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioTranscriptAnnotationAdded(ServerEvent, discriminator='response.audio_transcript.annotation.added'): + annotation: Any + annotation_index: int + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_AUDIO_TRANSCRIPT_ANNOTATION_ADDED] + + @overload + def __init__( + self, + *, + annotation: Any, + annotation_index: int, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioTranscriptDelta(ServerEvent, discriminator='response.audio_transcript.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_AUDIO_TRANSCRIPT_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseAudioTranscriptDone(ServerEvent, discriminator='response.audio_transcript.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + transcript: str + type: Literal[ServerEventType.RESPONSE_AUDIO_TRANSCRIPT_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + transcript: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseContentPartAdded(ServerEvent, discriminator='response.content_part.added'): + content_index: int + event_id: str + item_id: str + output_index: int + part: ContentPart + response_id: str + type: Literal[ServerEventType.RESPONSE_CONTENT_PART_ADDED] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + part: ContentPart, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseContentPartDone(ServerEvent, discriminator='response.content_part.done'): + content_index: int + event_id: str + item_id: str + output_index: int + part: ContentPart + response_id: str + type: Literal[ServerEventType.RESPONSE_CONTENT_PART_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + part: ContentPart, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseCreated(ServerEvent, discriminator='response.created'): + event_id: str + response: Response + type: Literal[ServerEventType.RESPONSE_CREATED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + response: Response + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseDone(ServerEvent, discriminator='response.done'): + event_id: str + response: Response + type: Literal[ServerEventType.RESPONSE_DONE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + response: Response + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseFileSearchCallCompleted(ServerEvent, discriminator='response.file_search_call.completed'): + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[ServerEventType.RESPONSE_FILE_SEARCH_CALL_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseFileSearchCallInProgress(ServerEvent, discriminator='response.file_search_call.in_progress'): + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[ServerEventType.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseFileSearchCallSearching(ServerEvent, discriminator='response.file_search_call.searching'): + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[ServerEventType.RESPONSE_FILE_SEARCH_CALL_SEARCHING] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseFunctionCallArgumentsDelta(ServerEvent, discriminator='response.function_call_arguments.delta'): + call_id: str + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( + self, + *, + call_id: str, + delta: str, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseFunctionCallArgumentsDone(ServerEvent, discriminator='response.function_call_arguments.done'): + arguments: str + call_id: str + event_id: str + item_id: str + name: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] + + @overload + def __init__( + self, + *, + arguments: str, + call_id: str, + event_id: Optional[str] = ..., + item_id: str, + name: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseInvocationDelta(ServerEvent, discriminator='response.invocation.delta'): + delta: dict[str, Any] + event_id: str + type: Literal[ServerEventType.RESPONSE_INVOCATION_DELTA] + + @overload + def __init__( + self, + *, + delta: dict[str, Any], + event_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseMcpCallArgumentsDelta(ServerEvent, discriminator='response.mcp_call_arguments.delta'): + delta: str + event_id: str + item_id: str + obfuscation: Optional[str] + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] + + @overload + def __init__( + self, + *, + delta: str, + event_id: Optional[str] = ..., + item_id: str, + obfuscation: Optional[str] = ..., + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseMcpCallArgumentsDone(ServerEvent, discriminator='response.mcp_call_arguments.done'): + arguments: Optional[str] + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] + + @overload + def __init__( + self, + *, + arguments: Optional[str] = ..., + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseMcpCallCompleted(ServerEvent, discriminator='response.mcp_call.completed'): + event_id: str + item_id: str + output_index: int + type: Literal[ServerEventType.RESPONSE_MCP_CALL_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseMcpCallFailed(ServerEvent, discriminator='response.mcp_call.failed'): + event_id: str + item_id: str + output_index: int + type: Literal[ServerEventType.RESPONSE_MCP_CALL_FAILED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseMcpCallInProgress(ServerEvent, discriminator='response.mcp_call.in_progress'): + event_id: str + item_id: str + output_index: int + type: Literal[ServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseOutputItemAdded(ServerEvent, discriminator='response.output_item.added'): + event_id: str + item: Optional[ResponseItem] + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: Optional[ResponseItem] = ..., + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseOutputItemDone(ServerEvent, discriminator='response.output_item.done'): + event_id: str + item: Optional[ResponseItem] + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_OUTPUT_ITEM_DONE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item: Optional[ResponseItem] = ..., + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseTextDelta(ServerEvent, discriminator='response.text.delta'): + content_index: int + delta: str + event_id: str + item_id: str + output_index: int + response_id: str + type: Literal[ServerEventType.RESPONSE_TEXT_DELTA] + + @overload + def __init__( + self, + *, + content_index: int, + delta: str, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseTextDone(ServerEvent, discriminator='response.text.done'): + content_index: int + event_id: str + item_id: str + output_index: int + response_id: str + text: str + type: Literal[ServerEventType.RESPONSE_TEXT_DONE] + + @overload + def __init__( + self, + *, + content_index: int, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseVideoDelta(ServerEvent, discriminator='response.video.delta'): + codec: str + delta: str + event_id: str + output_index: int + type: Literal[ServerEventType.RESPONSE_VIDEO_DELTA] + + @overload + def __init__( + self, + *, + codec: str, + delta: str, + event_id: Optional[str] = ..., + output_index: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseWebSearchCallCompleted(ServerEvent, discriminator='response.web_search_call.completed'): + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[ServerEventType.RESPONSE_WEB_SEARCH_CALL_COMPLETED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseWebSearchCallInProgress(ServerEvent, discriminator='response.web_search_call.in_progress'): + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[ServerEventType.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventResponseWebSearchCallSearching(ServerEvent, discriminator='response.web_search_call.searching'): + event_id: str + item_id: str + output_index: int + response_id: str + sequence_number: int + type: Literal[ServerEventType.RESPONSE_WEB_SEARCH_CALL_SEARCHING] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + item_id: str, + output_index: int, + response_id: str, + sequence_number: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventSessionAvatarConnecting(ServerEvent, discriminator='session.avatar.connecting'): + event_id: str + server_sdp: str + type: Literal[ServerEventType.SESSION_AVATAR_CONNECTING] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + server_sdp: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventSessionAvatarSwitchToIdle(ServerEvent, discriminator='session.avatar.switch_to_idle'): + event_id: str + turn_id: Optional[str] + type: Literal[ServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + turn_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventSessionAvatarSwitchToSpeaking(ServerEvent, discriminator='session.avatar.switch_to_speaking'): + event_id: str + turn_id: Optional[str] + type: Literal[ServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + turn_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventSessionCreated(ServerEvent, discriminator='session.created'): + event_id: str + session: ResponseSession + type: Literal[ServerEventType.SESSION_CREATED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: ResponseSession + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventSessionUpdated(ServerEvent, discriminator='session.updated'): + event_id: str + session: ResponseSession + type: Literal[ServerEventType.SESSION_UPDATED] + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + session: ResponseSession + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CONVERSATION_ITEM_CREATED = "conversation.item.created" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "conversation.item.input_audio_transcription.completed" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA = "conversation.item.input_audio_transcription.delta" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" + CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" + CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" + ERROR = "error" + INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" + INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" + MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" + MCP_LIST_TOOLS_FAILED = "mcp_list_tools.failed" + MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" + RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" + RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" + RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" + RESPONSE_AUDIO_DELTA = "response.audio.delta" + RESPONSE_AUDIO_DONE = "response.audio.done" + RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" + RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" + RESPONSE_AUDIO_TRANSCRIPT_ANNOTATION_ADDED = "response.audio_transcript.annotation.added" + RESPONSE_AUDIO_TRANSCRIPT_DELTA = "response.audio_transcript.delta" + RESPONSE_AUDIO_TRANSCRIPT_DONE = "response.audio_transcript.done" + RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" + RESPONSE_CONTENT_PART_DONE = "response.content_part.done" + RESPONSE_CREATED = "response.created" + RESPONSE_DONE = "response.done" + RESPONSE_FILE_SEARCH_CALL_COMPLETED = "response.file_search_call.completed" + RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS = "response.file_search_call.in_progress" + RESPONSE_FILE_SEARCH_CALL_SEARCHING = "response.file_search_call.searching" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" + RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" + RESPONSE_INVOCATION_DELTA = "response.invocation.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DELTA = "response.mcp_call_arguments.delta" + RESPONSE_MCP_CALL_ARGUMENTS_DONE = "response.mcp_call_arguments.done" + RESPONSE_MCP_CALL_COMPLETED = "response.mcp_call.completed" + RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" + RESPONSE_MCP_CALL_IN_PROGRESS = "response.mcp_call.in_progress" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + RESPONSE_TEXT_DELTA = "response.text.delta" + RESPONSE_TEXT_DONE = "response.text.done" + RESPONSE_VIDEO_DELTA = "response.video.delta" + RESPONSE_WEB_SEARCH_CALL_COMPLETED = "response.web_search_call.completed" + RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS = "response.web_search_call.in_progress" + RESPONSE_WEB_SEARCH_CALL_SEARCHING = "response.web_search_call.searching" + SESSION_AVATAR_CONNECTING = "session.avatar.connecting" + SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" + SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" + SESSION_CREATED = "session.created" + SESSION_UPDATED = "session.updated" + WARNING = "warning" + + + class azure.ai.voicelive.models.ServerEventWarning(ServerEvent, discriminator='warning'): + event_id: str + type: Literal[ServerEventType.WARNING] + warning: ServerEventWarningDetails + + @overload + def __init__( + self, + *, + event_id: Optional[str] = ..., + warning: ServerEventWarningDetails + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerEventWarningDetails(_Model): + code: Optional[str] + message: str + param: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + message: str, + param: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ServerVad(TurnDetection, discriminator='server_vad'): + auto_truncate: Optional[bool] + create_response: Optional[bool] + end_of_utterance_detection: Optional[EouDetection] + interrupt_response: Optional[bool] + prefix_padding_ms: Optional[int] + silence_duration_ms: Optional[int] + threshold: Optional[float] + type: Literal[TurnDetectionType.SERVER_VAD] + + @overload + def __init__( + self, + *, + auto_truncate: Optional[bool] = ..., + create_response: Optional[bool] = ..., + end_of_utterance_detection: Optional[EouDetection] = ..., + interrupt_response: Optional[bool] = ..., + prefix_padding_ms: Optional[int] = ..., + silence_duration_ms: Optional[int] = ..., + threshold: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.SessionBase(_Model): + + + class azure.ai.voicelive.models.SessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FILE_SEARCH_CALL_RESULTS = "file_search_call.results" + ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" + ITEM_INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" + + + class azure.ai.voicelive.models.StaticInterimResponseConfig(InterimResponseConfigBase, discriminator='static_interim_response'): + latency_threshold_ms: int + texts: Optional[list[str]] + triggers: Union[list[str, InterimResponseTrigger]] + type: Literal[InterimResponseConfigType.STATIC_INTERIM_RESPONSE] + + @overload + def __init__( + self, + *, + latency_threshold_ms: Optional[int] = ..., + texts: Optional[list[str]] = ..., + triggers: Optional[list[Union[str, InterimResponseTrigger]]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.SystemMessageItem(MessageItem, discriminator='system'): + content: list[MessageContentPart] + id: str + role: Literal[MessageRole.SYSTEM] + status: Union[str, ItemParamStatus] + type: Union[str, azure.ai.voicelive.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[MessageContentPart], + id: Optional[str] = ..., + status: Optional[Union[str, ItemParamStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.TokenUsage(_Model): + input_token_details: InputTokenDetails + input_tokens: int + output_token_details: OutputTokenDetails + output_tokens: int + total_tokens: int + + @overload + def __init__( + self, + *, + input_token_details: InputTokenDetails, + input_tokens: int, + output_token_details: OutputTokenDetails, + output_tokens: int, + total_tokens: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.Tool(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ToolChoiceFunctionSelection(ToolChoiceSelection, discriminator='function'): + name: str + type: Literal[ToolType.FUNCTION] + + @overload + def __init__( + self, + *, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ToolChoiceLiteral(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AUTO = "auto" + NONE = "none" + REQUIRED = "required" + + + class azure.ai.voicelive.models.ToolChoiceSelection(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FUNCTION = "function" + MCP = "mcp" + + + class azure.ai.voicelive.models.TranscriptionPhrase(_Model): + confidence: Optional[float] + duration_milliseconds: int + locale: Optional[str] + offset_milliseconds: int + text: str + words: Optional[list[TranscriptionWord]] + + @overload + def __init__( + self, + *, + confidence: Optional[float] = ..., + duration_milliseconds: int, + locale: Optional[str] = ..., + offset_milliseconds: int, + text: str, + words: Optional[list[TranscriptionWord]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.TranscriptionWord(_Model): + duration_milliseconds: int + offset_milliseconds: int + text: str + + @overload + def __init__( + self, + *, + duration_milliseconds: int, + offset_milliseconds: int, + text: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.TurnDetection(_Model): + type: str + + @overload + def __init__( + self, + *, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.TurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AZURE_SEMANTIC_VAD = "azure_semantic_vad" + AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" + AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" + SERVER_VAD = "server_vad" + + + class azure.ai.voicelive.models.UserMessageItem(MessageItem, discriminator='user'): + content: list[MessageContentPart] + id: str + role: Literal[MessageRole.USER] + status: Union[str, ItemParamStatus] + type: Union[str, azure.ai.voicelive.models.MESSAGE] + + @overload + def __init__( + self, + *, + content: list[MessageContentPart], + id: Optional[str] = ..., + status: Optional[Union[str, ItemParamStatus]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.VideoCrop(_Model): + bottom_right: list[int] + top_left: list[int] + + @overload + def __init__( + self, + *, + bottom_right: list[int], + top_left: list[int] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.VideoParams(_Model): + background: Optional[Background] + bitrate: Optional[int] + codec: Optional[Literal["h264"]] + crop: Optional[VideoCrop] + gop_size: Optional[int] + resolution: Optional[VideoResolution] + + @overload + def __init__( + self, + *, + background: Optional[Background] = ..., + bitrate: Optional[int] = ..., + codec: Optional[Literal[h264]] = ..., + crop: Optional[VideoCrop] = ..., + gop_size: Optional[int] = ..., + resolution: Optional[VideoResolution] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.VideoResolution(_Model): + height: int + width: int + + @overload + def __init__( + self, + *, + height: int, + width: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.ai.voicelive.models.VoiceLiveErrorDetails(_Model): + code: Optional[str] + event_id: Optional[str] + message: str + param: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + code: Optional[str] = ..., + event_id: Optional[str] = ..., + message: str, + param: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.ai.voicelive.telemetry + + class azure.ai.voicelive.telemetry.VoiceLiveInstrumentor: + + def __init__(self) -> None: ... + + def instrument(self, enable_content_recording: Optional[bool] = None) -> None: ... + + def is_content_recording_enabled(self) -> bool: ... + + def is_instrumented(self) -> bool: ... + + def uninstrument(self) -> None: ... + + +``` \ No newline at end of file diff --git a/sdk/voicelive/azure-ai-voicelive/api.metadata.yml b/sdk/voicelive/azure-ai-voicelive/api.metadata.yml new file mode 100644 index 000000000000..47bb90be74eb --- /dev/null +++ b/sdk/voicelive/azure-ai-voicelive/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 23e45934cf22eff4c25b6cebbd4ac49c64e8e3058d25af3980eebcc20730b353 +parserVersion: 0.3.28 +pythonVersion: 3.13.2 diff --git a/sdk/voicelive/azure-ai-voicelive/apiview-properties.json b/sdk/voicelive/azure-ai-voicelive/apiview-properties.json index 1eced9c5da63..a8182c31b7ce 100644 --- a/sdk/voicelive/azure-ai-voicelive/apiview-properties.json +++ b/sdk/voicelive/azure-ai-voicelive/apiview-properties.json @@ -48,7 +48,6 @@ "azure.ai.voicelive.models.ClientEventOutputAudioBufferClear": "VoiceLive.ClientEventOutputAudioBufferClear", "azure.ai.voicelive.models.ClientEventResponseCancel": "VoiceLive.ClientEventResponseCancel", "azure.ai.voicelive.models.ClientEventResponseCreate": "VoiceLive.ClientEventResponseCreate", - "azure.ai.voicelive.models.ClientEventRtcCallSdpCreate": "VoiceLive.ClientEventRtcCallSdpCreate", "azure.ai.voicelive.models.ClientEventSessionAvatarConnect": "VoiceLive.ClientEventSessionAvatarConnect", "azure.ai.voicelive.models.ClientEventSessionUpdate": "VoiceLive.ClientEventSessionUpdate", "azure.ai.voicelive.models.ContentPart": "VoiceLive.ContentPart", @@ -96,7 +95,6 @@ "azure.ai.voicelive.models.ResponseSession": "VoiceLive.ResponseSession", "azure.ai.voicelive.models.ResponseTextContentPart": "VoiceLive.ResponseTextContentPart", "azure.ai.voicelive.models.ResponseWebSearchCallItem": "VoiceLive.ResponseWebSearchCallItem", - "azure.ai.voicelive.models.RtcCallErrorDetails": "VoiceLive.RtcCallErrorDetails", "azure.ai.voicelive.models.Scene": "VoiceLive.Scene", "azure.ai.voicelive.models.ServerEvent": "VoiceLive.ServerEvent", "azure.ai.voicelive.models.ServerEventConversationItemCreated": "VoiceLive.ServerEventConversationItemCreated", @@ -116,8 +114,6 @@ "azure.ai.voicelive.models.ServerEventMcpListToolsFailed": "VoiceLive.ServerEventMcpListToolsFailed", "azure.ai.voicelive.models.ServerEventMcpListToolsInProgress": "VoiceLive.ServerEventMcpListToolsInProgress", "azure.ai.voicelive.models.ServerEventOutputAudioBufferCleared": "VoiceLive.ServerEventOutputAudioBufferCleared", - "azure.ai.voicelive.models.ServerEventOutputAudioBufferStarted": "VoiceLive.ServerEventOutputAudioBufferStarted", - "azure.ai.voicelive.models.ServerEventOutputAudioBufferStopped": "VoiceLive.ServerEventOutputAudioBufferStopped", "azure.ai.voicelive.models.ServerEventResponseAnimationBlendshapeDelta": "VoiceLive.ServerEventResponseAnimationBlendshapeDelta", "azure.ai.voicelive.models.ServerEventResponseAnimationBlendshapeDone": "VoiceLive.ServerEventResponseAnimationBlendshapeDone", "azure.ai.voicelive.models.ServerEventResponseAnimationVisemeDelta": "VoiceLive.ServerEventResponseAnimationVisemeDelta", @@ -152,8 +148,6 @@ "azure.ai.voicelive.models.ServerEventResponseWebSearchCallCompleted": "VoiceLive.ServerEventResponseWebSearchCallCompleted", "azure.ai.voicelive.models.ServerEventResponseWebSearchCallInProgress": "VoiceLive.ServerEventResponseWebSearchCallInProgress", "azure.ai.voicelive.models.ServerEventResponseWebSearchCallSearching": "VoiceLive.ServerEventResponseWebSearchCallSearching", - "azure.ai.voicelive.models.ServerEventRtcCallError": "VoiceLive.ServerEventRtcCallError", - "azure.ai.voicelive.models.ServerEventRtcCallSdpCreated": "VoiceLive.ServerEventRtcCallSdpCreated", "azure.ai.voicelive.models.ServerEventSessionAvatarConnecting": "VoiceLive.ServerEventSessionAvatarConnecting", "azure.ai.voicelive.models.ServerEventSessionAvatarSwitchToIdle": "VoiceLive.ServerEventSessionAvatarSwitchToIdle", "azure.ai.voicelive.models.ServerEventSessionAvatarSwitchToSpeaking": "VoiceLive.ServerEventSessionAvatarSwitchToSpeaking", @@ -163,7 +157,6 @@ "azure.ai.voicelive.models.ServerEventWarningDetails": "VoiceLive.ServerEventWarningDetails", "azure.ai.voicelive.models.ServerVad": "VoiceLive.ServerVad", "azure.ai.voicelive.models.SessionBase": "VoiceLive.SessionBase", - "azure.ai.voicelive.models.SmartEndOfTurnDetection": "VoiceLive.SmartEndOfTurnDetection", "azure.ai.voicelive.models.StaticInterimResponseConfig": "VoiceLive.StaticInterimResponseConfig", "azure.ai.voicelive.models.SystemMessageItem": "VoiceLive.SystemMessageItem", "azure.ai.voicelive.models.TokenUsage": "VoiceLive.TokenUsage", @@ -208,5 +201,5 @@ "azure.ai.voicelive.models.ResponseItemStatus": "VoiceLive.ResponseItemStatus", "azure.ai.voicelive.models.ServerEventType": "VoiceLive.ServerEventType" }, - "CrossLanguageVersion": "9b238185e57a" + "CrossLanguageVersion": "e710d3387810" } \ No newline at end of file diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_unions.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_unions.py new file mode 100644 index 000000000000..ae3e380f7eaa --- /dev/null +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_unions.py @@ -0,0 +1,17 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING, Union + +if TYPE_CHECKING: + from . import models as _models +Voice = Union[ + str, "_models.OpenAIVoiceName", "_models.OpenAIVoice", "_models.AzureVoice", "_models.AzureRealtimeNativeVoice" +] +ToolChoice = Union[str, "_models.ToolChoiceLiteral", "_models.ToolChoiceSelection"] +InterimResponseConfig = Union["_models.StaticInterimResponseConfig", "_models.LlmInterimResponseConfig"] diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/model_base.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/model_base.py index d725c55906d3..b93f5120d517 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/model_base.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/model_base.py @@ -109,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -301,6 +324,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -330,6 +359,10 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } @@ -564,7 +597,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/serialization.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/serialization.py index a088671e9c51..75906e2eb77f 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/serialization.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_utils/serialization.py @@ -520,6 +520,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1109,6 +1113,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1381,6 +1440,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1393,6 +1456,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1954,6 +2021,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_version.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_version.py index 0a49e23debd3..e616621bef1a 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_version.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.3.0b2" +VERSION = "1.3.0" diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py index 0e3dc33c7af3..69a99f13629e 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/aio/_patch.py @@ -672,7 +672,7 @@ def __init__( *, credential: Union["AzureKeyCredential", "AsyncTokenCredential"], endpoint: str, - api_version: str = "2026-06-01-preview", + api_version: str = "2026-07-15", model: Optional[str] = None, agent_config: Optional[Mapping[str, str]] = None, extra_query: Mapping[str, Any], @@ -875,7 +875,7 @@ def connect( *, credential: Union[AzureKeyCredential, AsyncTokenCredential], endpoint: str, - api_version: str = "2026-06-01-preview", + api_version: str = "2026-07-15", model: Optional[str] = None, query: Optional[Mapping[str, Any]] = None, headers: Optional[Mapping[str, Any]] = None, @@ -889,7 +889,7 @@ def connect( *, credential: Union[AzureKeyCredential, AsyncTokenCredential], endpoint: str, - api_version: str = "2026-06-01-preview", + api_version: str = "2026-07-15", model: Optional[str] = None, agent_name: str, project_name: str, @@ -908,7 +908,7 @@ def connect( *, credential: Union[AzureKeyCredential, AsyncTokenCredential], endpoint: str, - api_version: str = "2026-06-01-preview", + api_version: str = "2026-07-15", model: Optional[str] = None, agent_name: Optional[str] = None, project_name: Optional[str] = None, @@ -938,7 +938,7 @@ def connect( :paramtype credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.AsyncTokenCredential :keyword endpoint: Service endpoint, e.g., ``https://.api.cognitive.microsoft.com``. :paramtype endpoint: str - :keyword api_version: The API version to use. Defaults to ``"2026-06-01-preview"``. + :keyword api_version: The API version to use. Defaults to ``"2026-07-15"``. :paramtype api_version: str :keyword model: Model identifier to use for the session. In most scenarios, this parameter is required. diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/__init__.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/__init__.py index 0faee6cc415e..b4d6f8d36d6b 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/__init__.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/__init__.py @@ -57,7 +57,6 @@ ClientEventOutputAudioBufferClear, ClientEventResponseCancel, ClientEventResponseCreate, - ClientEventRtcCallSdpCreate, ClientEventSessionAvatarConnect, ClientEventSessionUpdate, ContentPart, @@ -107,7 +106,6 @@ ResponseStatusDetails, ResponseTextContentPart, ResponseWebSearchCallItem, - RtcCallErrorDetails, Scene, ServerEvent, ServerEventConversationItemCreated, @@ -127,8 +125,6 @@ ServerEventMcpListToolsFailed, ServerEventMcpListToolsInProgress, ServerEventOutputAudioBufferCleared, - ServerEventOutputAudioBufferStarted, - ServerEventOutputAudioBufferStopped, ServerEventResponseAnimationBlendshapeDelta, ServerEventResponseAnimationBlendshapeDone, ServerEventResponseAnimationVisemeDelta, @@ -163,8 +159,6 @@ ServerEventResponseWebSearchCallCompleted, ServerEventResponseWebSearchCallInProgress, ServerEventResponseWebSearchCallSearching, - ServerEventRtcCallError, - ServerEventRtcCallSdpCreated, ServerEventSessionAvatarConnecting, ServerEventSessionAvatarSwitchToIdle, ServerEventSessionAvatarSwitchToSpeaking, @@ -174,7 +168,6 @@ ServerEventWarningDetails, ServerVad, SessionBase, - SmartEndOfTurnDetection, StaticInterimResponseConfig, SystemMessageItem, TokenUsage, @@ -272,7 +265,6 @@ "ClientEventOutputAudioBufferClear", "ClientEventResponseCancel", "ClientEventResponseCreate", - "ClientEventRtcCallSdpCreate", "ClientEventSessionAvatarConnect", "ClientEventSessionUpdate", "ContentPart", @@ -322,7 +314,6 @@ "ResponseStatusDetails", "ResponseTextContentPart", "ResponseWebSearchCallItem", - "RtcCallErrorDetails", "Scene", "ServerEvent", "ServerEventConversationItemCreated", @@ -342,8 +333,6 @@ "ServerEventMcpListToolsFailed", "ServerEventMcpListToolsInProgress", "ServerEventOutputAudioBufferCleared", - "ServerEventOutputAudioBufferStarted", - "ServerEventOutputAudioBufferStopped", "ServerEventResponseAnimationBlendshapeDelta", "ServerEventResponseAnimationBlendshapeDone", "ServerEventResponseAnimationVisemeDelta", @@ -378,8 +367,6 @@ "ServerEventResponseWebSearchCallCompleted", "ServerEventResponseWebSearchCallInProgress", "ServerEventResponseWebSearchCallSearching", - "ServerEventRtcCallError", - "ServerEventRtcCallSdpCreated", "ServerEventSessionAvatarConnecting", "ServerEventSessionAvatarSwitchToIdle", "ServerEventSessionAvatarSwitchToSpeaking", @@ -389,7 +376,6 @@ "ServerEventWarningDetails", "ServerVad", "SessionBase", - "SmartEndOfTurnDetection", "StaticInterimResponseConfig", "SystemMessageItem", "TokenUsage", diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_enums.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_enums.py index db683065f510..bc0d282e0f12 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_enums.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_enums.py @@ -127,8 +127,6 @@ class ClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """MCP_APPROVAL_RESPONSE.""" OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" """Client request to clear the avatar output buffer.""" - RTC_CALL_SDP_CREATE = "rtc.call.sdp.create" - """Sent by the client to initiate a WebRTC session with an SDP offer.""" INPUT_TEXT_DELTA = "input_text.delta" """Streamed delta of input text content being appended to an item.""" INPUT_TEXT_DONE = "input_text.done" @@ -514,14 +512,6 @@ class ServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Audio transcript annotation added.""" RESPONSE_INVOCATION_DELTA = "response.invocation.delta" """Invocation passthrough delta from hosted agent.""" - RTC_CALL_SDP_CREATED = "rtc.call.sdp.created" - """Returned when the WebRTC SDP negotiation completes successfully.""" - RTC_CALL_ERROR = "rtc.call.error" - """Returned when a WebRTC call operation fails.""" - OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" - """Output audio buffer playback started.""" - OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" - """Output audio buffer playback stopped.""" class SessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_models.py b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_models.py index f6f204dfb9f8..4bfe589dd5f2 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_models.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/models/_models.py @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- # pylint: disable=useless-super-delegation +import datetime from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from .._utils.model_base import Model as _Model, rest_discriminator, rest_field @@ -25,7 +26,7 @@ ) if TYPE_CHECKING: - from .. import _types, models as _models + from .. import _unions, models as _models class ActionFind(_Model): @@ -429,7 +430,7 @@ class AudioEchoCancellation(_Model): TTS loopback is skipped. Known values are: \"server\" and \"client\".""" channels: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Number of input audio channels. - + * `1`: Mono input (default). * `2`: Interleaved stereo input where channel 0 is the microphone signal and channel 1 is the echo reference signal. @@ -1141,20 +1142,17 @@ class EouDetection(_Model): """Top-level union for end-of-utterance (EOU) semantic detection configuration. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureSemanticDetection, AzureSemanticDetectionEn, AzureSemanticDetectionMultilingual, - SmartEndOfTurnDetection + AzureSemanticDetection, AzureSemanticDetectionEn, AzureSemanticDetectionMultilingual :ivar model: Required. Is one of the following types: Literal["semantic_detection_v1"], - Literal["semantic_detection_v1_en"], Literal["semantic_detection_v1_multilingual"], - Literal["smart_end_of_turn_detection"], str - :vartype model: str or str or str or str or str + Literal["semantic_detection_v1_en"], Literal["semantic_detection_v1_multilingual"], str + :vartype model: str or str or str or str """ __mapping__: dict[str, _Model] = {} model: str = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) """Required. Is one of the following types: Literal[\"semantic_detection_v1\"], - Literal[\"semantic_detection_v1_en\"], Literal[\"semantic_detection_v1_multilingual\"], - Literal[\"smart_end_of_turn_detection\"], str""" + Literal[\"semantic_detection_v1_en\"], Literal[\"semantic_detection_v1_multilingual\"], str""" @overload def __init__( @@ -1797,7 +1795,7 @@ class ClientEvent(_Model): ClientEventInputAudioBufferAppend, ClientEventInputAudioBufferClear, ClientEventInputAudioBufferCommit, ClientEventInputTextDelta, ClientEventInputTextDone, ClientEventOutputAudioBufferClear, ClientEventResponseCancel, ClientEventResponseCreate, - ClientEventRtcCallSdpCreate, ClientEventSessionAvatarConnect, ClientEventSessionUpdate + ClientEventSessionAvatarConnect, ClientEventSessionUpdate :ivar type: The type of event. Required. Known values are: "session.update", "input_audio_buffer.append", "input_audio_buffer.commit", "input_audio_buffer.clear", @@ -1805,7 +1803,7 @@ class ClientEvent(_Model): "input_audio.turn.cancel", "input_audio.clear", "conversation.item.create", "conversation.item.retrieve", "conversation.item.truncate", "conversation.item.delete", "response.create", "response.cancel", "session.avatar.connect", "mcp_approval_response", - "output_audio_buffer.clear", "rtc.call.sdp.create", "input_text.delta", and "input_text.done". + "output_audio_buffer.clear", "input_text.delta", and "input_text.done". :vartype type: str or ~azure.ai.voicelive.models.ClientEventType :ivar event_id: :vartype event_id: str @@ -1819,8 +1817,8 @@ class ClientEvent(_Model): \"input_audio.turn.cancel\", \"input_audio.clear\", \"conversation.item.create\", \"conversation.item.retrieve\", \"conversation.item.truncate\", \"conversation.item.delete\", \"response.create\", \"response.cancel\", \"session.avatar.connect\", - \"mcp_approval_response\", \"output_audio_buffer.clear\", \"rtc.call.sdp.create\", - \"input_text.delta\", and \"input_text.done\".""" + \"mcp_approval_response\", \"output_audio_buffer.clear\", \"input_text.delta\", and + \"input_text.done\".""" event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload @@ -2549,50 +2547,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ClientEventType.RESPONSE_CREATE # type: ignore -class ClientEventRtcCallSdpCreate(ClientEvent, discriminator="rtc.call.sdp.create"): - """Sent by the client to initiate a WebRTC session with an SDP offer. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``rtc.call.sdp.create``. Required. Sent by the client to - initiate a WebRTC session with an SDP offer. - :vartype type: str or ~azure.ai.voicelive.models.RTC_CALL_SDP_CREATE - :ivar sdp_offer: The SDP offer from the client for WebRTC negotiation. Required. - :vartype sdp_offer: str - :ivar session: Optional initial session configuration. If provided, applied before the session - is established. - :vartype session: ~azure.ai.voicelive.models.RequestSession - """ - - type: Literal[ClientEventType.RTC_CALL_SDP_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``rtc.call.sdp.create``. Required. Sent by the client to initiate a - WebRTC session with an SDP offer.""" - sdp_offer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SDP offer from the client for WebRTC negotiation. Required.""" - session: Optional["_models.RequestSession"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional initial session configuration. If provided, applied before the session is established.""" - - @overload - def __init__( - self, - *, - sdp_offer: str, - event_id: Optional[str] = None, - session: Optional["_models.RequestSession"] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ClientEventType.RTC_CALL_SDP_CREATE # type: ignore - - class ClientEventSessionAvatarConnect(ClientEvent, discriminator="session.avatar.connect"): """Sent when the client connects and provides its SDP (Session Description Protocol) @@ -3714,7 +3668,7 @@ class RequestSession(_Model): """The modalities to be used in the session.""" animation: Optional["_models.Animation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The animation configuration for the session.""" - voice: Optional["_types.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + voice: Optional["_unions.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The voice configuration for the session. Is one of the following types: Union[str, \"_models.OpenAIVoiceName\"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice""" instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3759,7 +3713,7 @@ class RequestSession(_Model): """Types of timestamps to include in audio response content.""" tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Configuration for tools to be used during the session, if applicable.""" - tool_choice: Optional["_types.ToolChoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tool_choice: Optional["_unions.ToolChoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies which tools the model is allowed to call during the session. Is either a Union[str, \"_models.ToolChoiceLiteral\"] type or a ToolChoiceSelection type.""" parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -3778,7 +3732,7 @@ class RequestSession(_Model): values for each model. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" - interim_response: Optional["_types.InterimResponseConfig"] = rest_field( + interim_response: Optional["_unions.InterimResponseConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Configuration for interim response generation during latency or tool calls. Is either a @@ -3801,7 +3755,7 @@ def __init__( model: Optional[str] = None, modalities: Optional[list[Union[str, "_models.Modality"]]] = None, animation: Optional["_models.Animation"] = None, - voice: Optional["_types.Voice"] = None, + voice: Optional["_unions.Voice"] = None, instructions: Optional[str] = None, input_audio_sampling_rate: Optional[int] = None, input_audio_format: Optional[Union[str, "_models.InputAudioFormat"]] = None, @@ -3813,12 +3767,12 @@ def __init__( input_audio_transcription: Optional["_models.AudioInputTranscriptionOptions"] = None, output_audio_timestamp_types: Optional[list[Union[str, "_models.AudioTimestampType"]]] = None, tools: Optional[list["_models.Tool"]] = None, - tool_choice: Optional["_types.ToolChoice"] = None, + tool_choice: Optional["_unions.ToolChoice"] = None, parallel_tool_calls: Optional[bool] = None, temperature: Optional[float] = None, max_response_output_tokens: Optional[Union[int, Literal["inf"]]] = None, reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, - interim_response: Optional["_types.InterimResponseConfig"] = None, + interim_response: Optional["_unions.InterimResponseConfig"] = None, include: Optional[list[Union[str, "_models.SessionIncludeOption"]]] = None, metadata: Optional[dict[str, str]] = None, ) -> None: ... @@ -3952,7 +3906,7 @@ class Response(_Model): response will not be added to any conversation and the value of ``conversation_id`` will be ``null``. If responses are being triggered by server VAD, the response will be added to the default conversation, thus the ``conversation_id`` will be an id like ``conv_1234``.""" - voice: Optional["_types.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + voice: Optional["_unions.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """supported voice identifiers and configurations. Is one of the following types: Union[str, \"_models.OpenAIVoiceName\"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice""" modalities: Optional[list[Union[str, "_models.Modality"]]] = rest_field( @@ -3989,7 +3943,7 @@ def __init__( output: Optional[list["_models.ResponseItem"]] = None, usage: Optional["_models.TokenUsage"] = None, conversation_id: Optional[str] = None, - voice: Optional["_types.Voice"] = None, + voice: Optional["_unions.Voice"] = None, modalities: Optional[list[Union[str, "_models.Modality"]]] = None, output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = None, temperature: Optional[float] = None, @@ -4179,7 +4133,7 @@ class ResponseCreateParams(_Model): calls. Is either a StaticInterimResponseConfig type or a LlmInterimResponseConfig type. :vartype interim_response: ~azure.ai.voicelive.models.StaticInterimResponseConfig or ~azure.ai.voicelive.models.LlmInterimResponseConfig - :ivar invoke_input: Input data to invoke the hosted agent. This feature is in preview. + :ivar invoke_input: Input data to invoke the hosted agent. :vartype invoke_input: dict[str, any] """ @@ -4213,7 +4167,7 @@ class ResponseCreateParams(_Model): Note that the server sets default instructions which will be used if this field is not set and are visible in the ``session.created`` event at the start of the session.""" - voice: Optional["_types.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + voice: Optional["_unions.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """supported voice identifiers and configurations. Is one of the following types: Union[str, \"_models.OpenAIVoiceName\"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice""" output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = rest_field( @@ -4251,13 +4205,13 @@ class ResponseCreateParams(_Model): """Set of up to 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.""" - interim_response: Optional["_types.InterimResponseConfig"] = rest_field( + interim_response: Optional["_unions.InterimResponseConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Configuration for interim response generation during latency or tool calls. Is either a StaticInterimResponseConfig type or a LlmInterimResponseConfig type.""" invoke_input: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input data to invoke the hosted agent. This feature is in preview.""" + """Input data to invoke the hosted agent.""" @overload def __init__( @@ -4269,7 +4223,7 @@ def __init__( input_items: Optional[list["_models.ConversationRequestItem"]] = None, modalities: Optional[list[Union[str, "_models.Modality"]]] = None, instructions: Optional[str] = None, - voice: Optional["_types.Voice"] = None, + voice: Optional["_unions.Voice"] = None, output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = None, tools: Optional[list["_models.Tool"]] = None, tool_choice: Optional[str] = None, @@ -4278,7 +4232,7 @@ def __init__( pre_generated_assistant_message: Optional["_models.AssistantMessageItem"] = None, reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, metadata: Optional[dict[str, str]] = None, - interim_response: Optional["_types.InterimResponseConfig"] = None, + interim_response: Optional["_unions.InterimResponseConfig"] = None, invoke_input: Optional[dict[str, Any]] = None, ) -> None: ... @@ -4914,6 +4868,9 @@ class ResponseSession(_Model): :vartype agent: ~azure.ai.voicelive.models.AgentConfig :ivar id: The unique identifier for the session. :vartype id: str + :ivar expires_at: Expiration time for the session. This value is set by the server and cannot + be changed with ``session.update``. + :vartype expires_at: ~datetime.datetime """ model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -4924,7 +4881,7 @@ class ResponseSession(_Model): """The modalities to be used in the session.""" animation: Optional["_models.Animation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The animation configuration for the session.""" - voice: Optional["_types.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + voice: Optional["_unions.Voice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The voice configuration for the session. Is one of the following types: Union[str, \"_models.OpenAIVoiceName\"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice""" instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -4969,7 +4926,7 @@ class ResponseSession(_Model): """Types of timestamps to include in audio response content.""" tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Configuration for tools to be used during the session, if applicable.""" - tool_choice: Optional["_types.ToolChoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tool_choice: Optional["_unions.ToolChoice"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Specifies which tools the model is allowed to call during the session. Is either a Union[str, \"_models.ToolChoiceLiteral\"] type or a ToolChoiceSelection type.""" parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -4988,7 +4945,7 @@ class ResponseSession(_Model): values for each model. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Known values are: \"none\", \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" - interim_response: Optional["_types.InterimResponseConfig"] = rest_field( + interim_response: Optional["_unions.InterimResponseConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """Configuration for interim response generation during latency or tool calls. Is either a @@ -5007,6 +4964,11 @@ class ResponseSession(_Model): """The agent configuration for the session, if applicable.""" id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The unique identifier for the session.""" + expires_at: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="unix-timestamp" + ) + """Expiration time for the session. This value is set by the server and cannot be changed with + ``session.update``.""" @overload def __init__( # pylint: disable=too-many-locals @@ -5015,7 +4977,7 @@ def __init__( # pylint: disable=too-many-locals model: Optional[str] = None, modalities: Optional[list[Union[str, "_models.Modality"]]] = None, animation: Optional["_models.Animation"] = None, - voice: Optional["_types.Voice"] = None, + voice: Optional["_unions.Voice"] = None, instructions: Optional[str] = None, input_audio_sampling_rate: Optional[int] = None, input_audio_format: Optional[Union[str, "_models.InputAudioFormat"]] = None, @@ -5027,16 +4989,17 @@ def __init__( # pylint: disable=too-many-locals input_audio_transcription: Optional["_models.AudioInputTranscriptionOptions"] = None, output_audio_timestamp_types: Optional[list[Union[str, "_models.AudioTimestampType"]]] = None, tools: Optional[list["_models.Tool"]] = None, - tool_choice: Optional["_types.ToolChoice"] = None, + tool_choice: Optional["_unions.ToolChoice"] = None, parallel_tool_calls: Optional[bool] = None, temperature: Optional[float] = None, max_response_output_tokens: Optional[Union[int, Literal["inf"]]] = None, reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, - interim_response: Optional["_types.InterimResponseConfig"] = None, + interim_response: Optional["_unions.InterimResponseConfig"] = None, include: Optional[list[Union[str, "_models.SessionIncludeOption"]]] = None, metadata: Optional[dict[str, str]] = None, agent: Optional["_models.AgentConfig"] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin + expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -5126,44 +5089,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ItemType.WEB_SEARCH_CALL # type: ignore -class RtcCallErrorDetails(_Model): - """Error details for RTC call errors. - - :ivar type: The error category: ``invalid_request_error`` or ``server_error``. Required. - :vartype type: str - :ivar code: A machine-readable error code. - :vartype code: str - :ivar message: A human-readable error description. Required. - :vartype message: str - """ - - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error category: ``invalid_request_error`` or ``server_error``. Required.""" - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A machine-readable error code.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable error description. Required.""" - - @overload - def __init__( - self, - *, - type: str, - message: str, - code: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - class Scene(_Model): """Configuration for avatar's zoom level, position, rotation and movement amplitude in the video frame. @@ -5249,8 +5174,7 @@ class ServerEvent(_Model): ServerEventInputAudioBufferCommitted, ServerEventInputAudioBufferSpeechStarted, ServerEventInputAudioBufferSpeechStopped, ServerEventMcpListToolsCompleted, ServerEventMcpListToolsFailed, ServerEventMcpListToolsInProgress, - ServerEventOutputAudioBufferCleared, ServerEventOutputAudioBufferStarted, - ServerEventOutputAudioBufferStopped, ServerEventResponseAnimationBlendshapeDelta, + ServerEventOutputAudioBufferCleared, ServerEventResponseAnimationBlendshapeDelta, ServerEventResponseAnimationBlendshapeDone, ServerEventResponseAnimationVisemeDelta, ServerEventResponseAnimationVisemeDone, ServerEventResponseAudioDelta, ServerEventResponseAudioDone, ServerEventResponseAudioTimestampDelta, @@ -5267,9 +5191,9 @@ class ServerEvent(_Model): ServerEventResponseOutputItemDone, ServerEventResponseTextDelta, ServerEventResponseTextDone, ServerEventResponseVideoDelta, ServerEventResponseWebSearchCallCompleted, ServerEventResponseWebSearchCallInProgress, ServerEventResponseWebSearchCallSearching, - ServerEventRtcCallError, ServerEventRtcCallSdpCreated, ServerEventSessionAvatarConnecting, - ServerEventSessionAvatarSwitchToIdle, ServerEventSessionAvatarSwitchToSpeaking, - ServerEventSessionCreated, ServerEventSessionUpdated, ServerEventWarning + ServerEventSessionAvatarConnecting, ServerEventSessionAvatarSwitchToIdle, + ServerEventSessionAvatarSwitchToSpeaking, ServerEventSessionCreated, ServerEventSessionUpdated, + ServerEventWarning :ivar type: The type of event. Required. Known values are: "error", "warning", "session.avatar.connecting", "session.created", "session.updated", @@ -5294,9 +5218,7 @@ class ServerEvent(_Model): "response.web_search_call.in_progress", "response.web_search_call.completed", "response.file_search_call.searching", "response.file_search_call.in_progress", "response.file_search_call.completed", "output_audio_buffer.cleared", - "response.audio_transcript.annotation.added", "response.invocation.delta", - "rtc.call.sdp.created", "rtc.call.error", "output_audio_buffer.started", and - "output_audio_buffer.stopped". + "response.audio_transcript.annotation.added", and "response.invocation.delta". :vartype type: str or ~azure.ai.voicelive.models.ServerEventType :ivar event_id: :vartype event_id: str @@ -5329,9 +5251,7 @@ class ServerEvent(_Model): \"response.web_search_call.in_progress\", \"response.web_search_call.completed\", \"response.file_search_call.searching\", \"response.file_search_call.in_progress\", \"response.file_search_call.completed\", \"output_audio_buffer.cleared\", - \"response.audio_transcript.annotation.added\", \"response.invocation.delta\", - \"rtc.call.sdp.created\", \"rtc.call.error\", \"output_audio_buffer.started\", and - \"output_audio_buffer.stopped\".""" + \"response.audio_transcript.annotation.added\", and \"response.invocation.delta\".""" event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload @@ -6124,82 +6044,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore -class ServerEventOutputAudioBufferStarted(ServerEvent, discriminator="output_audio_buffer.started"): - """Returned when model audio output starts playing. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.started``. Required. Output audio - buffer playback started. - :vartype type: str or ~azure.ai.voicelive.models.OUTPUT_AUDIO_BUFFER_STARTED - :ivar response_id: The ID of the response whose audio started playing. - :vartype response_id: str - """ - - type: Literal[ServerEventType.OUTPUT_AUDIO_BUFFER_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.started``. Required. Output audio buffer playback - started.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response whose audio started playing.""" - - @overload - def __init__( - self, - *, - event_id: Optional[str] = None, - response_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ServerEventType.OUTPUT_AUDIO_BUFFER_STARTED # type: ignore - - -class ServerEventOutputAudioBufferStopped(ServerEvent, discriminator="output_audio_buffer.stopped"): - """Returned when model audio output finishes playing. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.stopped``. Required. Output audio - buffer playback stopped. - :vartype type: str or ~azure.ai.voicelive.models.OUTPUT_AUDIO_BUFFER_STOPPED - :ivar response_id: The ID of the response whose audio stopped playing. - :vartype response_id: str - """ - - type: Literal[ServerEventType.OUTPUT_AUDIO_BUFFER_STOPPED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.stopped``. Required. Output audio buffer playback - stopped.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response whose audio stopped playing.""" - - @overload - def __init__( - self, - *, - event_id: Optional[str] = None, - response_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ServerEventType.OUTPUT_AUDIO_BUFFER_STOPPED # type: ignore - - class ServerEventResponseAnimationBlendshapeDelta( ServerEvent, discriminator="response.animation_blendshapes.delta" ): # pylint: disable=name-too-long @@ -8005,97 +7849,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type = ServerEventType.RESPONSE_WEB_SEARCH_CALL_SEARCHING # type: ignore -class ServerEventRtcCallError(ServerEvent, discriminator="rtc.call.error"): - """Returned when a WebRTC call operation fails. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``rtc.call.error``. Required. Returned when a WebRTC call - operation fails. - :vartype type: str or ~azure.ai.voicelive.models.RTC_CALL_ERROR - :ivar operation: The operation that caused the error (e.g., ``rtc.call.sdp.create``). - :vartype operation: str - :ivar rtc_call_id: The RTC call identifier, if available. - :vartype rtc_call_id: str - :ivar error: The error details. Required. - :vartype error: ~azure.ai.voicelive.models.RtcCallErrorDetails - """ - - type: Literal[ServerEventType.RTC_CALL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``rtc.call.error``. Required. Returned when a WebRTC call operation - fails.""" - operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The operation that caused the error (e.g., ``rtc.call.sdp.create``).""" - rtc_call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The RTC call identifier, if available.""" - error: "_models.RtcCallErrorDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error details. Required.""" - - @overload - def __init__( - self, - *, - error: "_models.RtcCallErrorDetails", - event_id: Optional[str] = None, - operation: Optional[str] = None, - rtc_call_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ServerEventType.RTC_CALL_ERROR # type: ignore - - -class ServerEventRtcCallSdpCreated(ServerEvent, discriminator="rtc.call.sdp.created"): - """Returned when the WebRTC SDP negotiation completes successfully. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``rtc.call.sdp.created``. Required. Returned when the - WebRTC SDP negotiation completes successfully. - :vartype type: str or ~azure.ai.voicelive.models.RTC_CALL_SDP_CREATED - :ivar rtc_call_id: The unique identifier for this RTC call session. Required. - :vartype rtc_call_id: str - :ivar sdp_answer: The SDP answer from the server for WebRTC negotiation. Required. - :vartype sdp_answer: str - """ - - type: Literal[ServerEventType.RTC_CALL_SDP_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``rtc.call.sdp.created``. Required. Returned when the WebRTC SDP - negotiation completes successfully.""" - rtc_call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique identifier for this RTC call session. Required.""" - sdp_answer: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The SDP answer from the server for WebRTC negotiation. Required.""" - - @overload - def __init__( - self, - *, - rtc_call_id: str, - sdp_answer: str, - event_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.type = ServerEventType.RTC_CALL_SDP_CREATED # type: ignore - - class ServerEventSessionAvatarConnecting(ServerEvent, discriminator="session.avatar.connecting"): """Sent when the server is in the process of establishing an avatar media connection and provides its SDP answer. @@ -8431,49 +8184,6 @@ class SessionBase(_Model): """VoiceLive session object configuration.""" -class SmartEndOfTurnDetection(EouDetection, discriminator="smart_end_of_turn_detection"): - """Audio-based end-of-turn detection. Operates directly on the input audio stream rather than - text. Use ``threshold_level`` and ``timeout_ms`` to tune detection. - - :ivar model: Required. Default value is "smart_end_of_turn_detection". - :vartype model: str - :ivar threshold_level: Threshold level setting. One of ``low``, ``medium``, ``high``, or - ``default``. Known values are: "low", "medium", "high", and "default". - :vartype threshold_level: str or ~azure.ai.voicelive.models.EouThresholdLevel - :ivar timeout_ms: Timeout in milliseconds. - :vartype timeout_ms: int - """ - - model: Literal["smart_end_of_turn_detection"] = rest_discriminator(name="model", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. Default value is \"smart_end_of_turn_detection\".""" - threshold_level: Optional[Union[str, "_models.EouThresholdLevel"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Threshold level setting. One of ``low``, ``medium``, ``high``, or ``default``. Known values - are: \"low\", \"medium\", \"high\", and \"default\".""" - timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Timeout in milliseconds.""" - - @overload - def __init__( - self, - *, - threshold_level: Optional[Union[str, "_models.EouThresholdLevel"]] = None, - timeout_ms: Optional[int] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - self.model = "smart_end_of_turn_detection" # type: ignore - - class StaticInterimResponseConfig(InterimResponseConfigBase, discriminator="static_interim_response"): """Configuration for static interim response generation. Randomly selects from configured texts when any trigger condition is met. diff --git a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/telemetry/README.md b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/telemetry/README.md index fc6952dec13e..4f0436632a7d 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/telemetry/README.md +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/telemetry/README.md @@ -106,7 +106,7 @@ connect (parent span — open for the entire session lifetime) | `az.namespace` | string | Always `"Microsoft.CognitiveServices"` | | `gen_ai.system` | string | Always `"az.ai.voicelive"` | | `gen_ai.operation.name` | string | The operation: `connect`, `send`, `recv`, `close` | -| `gen_ai.request.model` | string | The model name (e.g., `gpt-4o-realtime-preview`) | +| `gen_ai.request.model` | string | The model name (e.g., `gpt-realtime`) | | `gen_ai.usage.input_tokens` | int | Input token count (from `response.done` usage) | | `gen_ai.usage.output_tokens` | int | Output token count (from `response.done` usage) | | `server.address` | string | Server hostname | diff --git a/sdk/voicelive/azure-ai-voicelive/pyproject.toml b/sdk/voicelive/azure-ai-voicelive/pyproject.toml index f966545977e7..13768cdd3b71 100644 --- a/sdk/voicelive/azure-ai-voicelive/pyproject.toml +++ b/sdk/voicelive/azure-ai-voicelive/pyproject.toml @@ -17,7 +17,7 @@ authors = [ description = "Microsoft Corporation Azure Ai Voicelive Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -25,6 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] requires-python = ">=3.10" keywords = ["azure", "azure sdk"] diff --git a/sdk/voicelive/azure-ai-voicelive/samples/README.md b/sdk/voicelive/azure-ai-voicelive/samples/README.md index f158205db1b0..4e49b0ae218e 100644 --- a/sdk/voicelive/azure-ai-voicelive/samples/README.md +++ b/sdk/voicelive/azure-ai-voicelive/samples/README.md @@ -122,9 +122,9 @@ python basic_voice_assistant_async.py --help ## Sample descriptions - **basic_voice_assistant_async.py**: 🌟 **[Featured Sample]** Complete async voice assistant demonstrating real-time conversation, interruption handling, and server VAD. Supports optional OpenTelemetry tracing via `--enable-tracing`, defaults to Entra ID auth, and writes logs to standard output instead of creating log files. See "BASIC_VOICE_ASSISTANT.md" for detailed documentation. -- **agent_v2_sample.py**: Demonstrates how to connect to an Azure AI Foundry agent using flattened `connect()` keyword arguments. Shows the new pattern where agents are configured at connection time rather than as tools in the session. Features callback-based audio streaming, sequence number based interrupt handling, standard logger output for conversation events, and defaults the agent connection to API version `2026-04-10`. +- **agent_v2_sample.py**: Demonstrates how to connect to an Azure AI Foundry agent using flattened `connect()` keyword arguments. Shows the new pattern where agents are configured at connection time rather than as tools in the session. Features callback-based audio streaming, sequence number based interrupt handling, standard logger output for conversation events, and defaults the agent connection to API version `2026-07-15`. - **async_function_calling_sample.py**: Demonstrates async function calling capabilities with the VoiceLive SDK, showing how to handle function calls from the AI model. -- **async_mcp_sample.py**: Demonstrates async MCP capabilities with Entra ID-first authentication and uses API version `2026-04-10` for MCP support. +- **async_mcp_sample.py**: Demonstrates async MCP capabilities with Entra ID-first authentication and uses API version `2026-07-15` for MCP support. ### Telemetry samples diff --git a/sdk/voicelive/azure-ai-voicelive/samples/agent_v2_sample.py b/sdk/voicelive/azure-ai-voicelive/samples/agent_v2_sample.py index 4016506fcca3..24ce3f3f0e9b 100644 --- a/sdk/voicelive/azure-ai-voicelive/samples/agent_v2_sample.py +++ b/sdk/voicelive/azure-ai-voicelive/samples/agent_v2_sample.py @@ -46,7 +46,7 @@ - AGENT_CONVERSATION_ID - Existing conversation ID to continue - AGENT_VOICE - Voice to use (default: en-US-Ava:DragonHDLatestNeural) - AZURE_VOICELIVE_API_VERSION - VoiceLive API version to use for the agent connection - (default: 2026-04-10) + (default: 2026-07-15) - FOUNDRY_RESOURCE_OVERRIDE - Override for the Foundry resource URL - AGENT_AUTH_IDENTITY_CLIENT_ID - Client ID for agent authentication """ @@ -113,7 +113,7 @@ agent_version = os.environ.get("AGENT_VERSION") # Optional agent_conversation_id = os.environ.get("AGENT_CONVERSATION_ID") # Optional agent_voice = os.environ.get("AGENT_VOICE", "en-US-Ava:DragonHDLatestNeural") -agent_api_version = os.environ.get("AZURE_VOICELIVE_API_VERSION", "2026-04-10") +agent_api_version = os.environ.get("AZURE_VOICELIVE_API_VERSION", "2026-07-15") foundry_resource_override = os.environ.get("FOUNDRY_RESOURCE_OVERRIDE") # Optional agent_auth_identity_client_id = os.environ.get("AGENT_AUTH_IDENTITY_CLIENT_ID") # Optional diff --git a/sdk/voicelive/azure-ai-voicelive/samples/async_mcp_sample.py b/sdk/voicelive/azure-ai-voicelive/samples/async_mcp_sample.py index 8561b9144f8c..4b52c496a5ef 100644 --- a/sdk/voicelive/azure-ai-voicelive/samples/async_mcp_sample.py +++ b/sdk/voicelive/azure-ai-voicelive/samples/async_mcp_sample.py @@ -13,7 +13,7 @@ DESCRIPTION: This sample demonstrates how to use the Azure AI Voice Live SDK asynchronously with MCP capabilities. It shows how to define mcp servers, handle mcp call events, - and connects with API version 2026-04-10 because MCP support requires that service version. + and connects with API version 2026-07-15 because MCP support requires that service version. USAGE: python async_mcp_sample.py @@ -378,12 +378,12 @@ async def run(self): logger.info(f"Connecting to VoiceLive API with model {self.model}") # Connect to VoiceLive WebSocket API asynchronously - # Using 2026-04-10 API version for MCP support + # Using 2026-07-15 API version for MCP support async with connect( endpoint=self.endpoint, credential=self.credential, model=self.model, - api_version="2026-04-10", + api_version="2026-07-15", ) as connection: # Initialize audio processor self.audio_processor = AudioProcessor(connection) @@ -653,7 +653,7 @@ async def _handle_mcp_call_arguments(self, conversation_created_event, connectio async def main(): """Main async function.""" - # Note: Use api_version="2026-04-10" to enable MCP features + # Note: Use api_version="2026-07-15" to enable MCP features endpoint = os.environ.get("AZURE_VOICELIVE_ENDPOINT", "wss://api.voicelive.com/v1") model = os.environ.get("AZURE_VOICELIVE_MODEL", "gpt-realtime") use_api_key = os.environ.get("AZURE_VOICELIVE_USE_API_KEY", "").strip().lower() in {"1", "true", "yes"} diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_audio.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_audio.py index 52347772d99a..7307f93a552b 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_audio.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_audio.py @@ -41,7 +41,7 @@ class TestRealtimeServiceAudio(AzureRecordedTestCase): @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4o"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_audio_enhancements( self, test_data_dir: Path, @@ -134,7 +134,7 @@ async def test_realtime_service_with_audio_enhancements( ), ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_input_audio_format( self, test_data_dir: Path, @@ -209,7 +209,7 @@ async def test_realtime_service_with_input_audio_format( pytest.param("phi4-mm-realtime", 44100, id="phi4_mm_realtime_44kHz_no_resample"), ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_input_audio_sampling_rate( self, test_data_dir: Path, model: str, sampling_rate: int, api_version: str, **kwargs ): @@ -273,7 +273,7 @@ async def test_realtime_service_with_input_audio_sampling_rate( "g711_alaw", ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_output_formats_with_azure_voice( self, test_data_dir: Path, model: str, audio_output_format: str, api_version: str, **kwargs ): @@ -314,7 +314,7 @@ async def test_output_formats_with_azure_voice( "g711_alaw", ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_output_formats_with_openai_voice( self, test_data_dir: Path, model: str, audio_output_format: str, api_version: str, **kwargs ): @@ -347,7 +347,7 @@ async def test_output_formats_with_openai_voice( @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4.1"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_echo_cancellation( self, test_data_dir: Path, @@ -397,7 +397,7 @@ async def test_realtime_service_with_echo_cancellation( "g711_alaw", ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_write_loopback_audio_echo_cancellation( self, test_data_dir: Path, model: str, audio_output_format: str, api_version: str, **kwargs ): diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_avatar.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_avatar.py index cdac28686c07..db83a14d9053 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_avatar.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_avatar.py @@ -40,7 +40,7 @@ class TestRealtimeServiceAvatar(AzureRecordedTestCase): @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4.1"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_audio_timestamp_viseme( self, test_data_dir: Path, @@ -98,7 +98,7 @@ async def test_realtime_service_with_audio_timestamp_viseme( @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4.1", "phi4-mm-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_voice_properties( self, test_data_dir: Path, diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_basic.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_basic.py index 8220f4f86ab7..9c70c425a55f 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_basic.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_basic.py @@ -53,7 +53,7 @@ def smoke_test(self, **kwargs): @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4.1", "phi4-mm-realtime", "phi4-mini"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service(self, test_data_dir: Path, model: str, api_version: str, **kwargs): voicelive_openai_endpoint = kwargs.pop("voicelive_openai_endpoint") voicelive_openai_api_key = kwargs.pop("voicelive_openai_api_key") @@ -107,7 +107,7 @@ async def test_realtime_service(self, test_data_dir: Path, model: str, api_versi @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-05-01-preview", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-05-01-preview", "2026-07-15"]) async def test_realtime_service_live_session_update( self, test_data_dir: Path, @@ -185,7 +185,7 @@ async def test_realtime_service_live_session_update( @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_retrieve_item(self, test_data_dir: Path, model: str, api_version: str, **kwargs): file = test_data_dir / "largest_lake.wav" voicelive_openai_endpoint = kwargs.pop("voicelive_openai_endpoint") @@ -228,7 +228,7 @@ async def test_realtime_service_retrieve_item(self, test_data_dir: Path, model: @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-05-01-preview", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-05-01-preview", "2026-07-15"]) async def test_realtime_service_truncate_item(self, test_data_dir: Path, model: str, api_version: str, **kwargs): file = test_data_dir / "largest_lake.wav" voicelive_openai_endpoint = kwargs.pop("voicelive_openai_endpoint") diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_lifecycle.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_lifecycle.py index 8170a7f30f60..d1feaf99ba14 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_lifecycle.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_lifecycle.py @@ -40,7 +40,7 @@ class TestRealtimeServiceLifecycle(AzureRecordedTestCase): @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_response_cancel(self, model: str, api_version: str, **kwargs): voicelive_openai_endpoint = kwargs.pop("voicelive_openai_endpoint") voicelive_openai_api_key = kwargs.pop("voicelive_openai_api_key") @@ -59,9 +59,7 @@ async def test_realtime_service_response_cancel(self, model: str, api_version: s # Seed a user message so the model has something to respond to. await conn.conversation.item.create( - item=UserMessageItem( - content=[InputTextContentPart(text="Tell me a very long story about the ocean.")] - ) + item=UserMessageItem(content=[InputTextContentPart(text="Tell me a very long story about the ocean.")]) ) await conn.response.create() @@ -77,7 +75,7 @@ async def test_realtime_service_response_cancel(self, model: str, api_version: s @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_conversation_item_delete(self, model: str, api_version: str, **kwargs): voicelive_openai_endpoint = kwargs.pop("voicelive_openai_endpoint") voicelive_openai_api_key = kwargs.pop("voicelive_openai_api_key") @@ -107,7 +105,7 @@ async def test_realtime_service_conversation_item_delete(self, model: str, api_v @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_input_audio_buffer_clear( self, test_data_dir: Path, model: str, api_version: str, **kwargs ): diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_tools.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_tools.py index 45488394f076..c3d88126f52a 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_tools.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_tools.py @@ -51,7 +51,7 @@ class TestRealtimeServiceTools(AzureRecordedTestCase): @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4o"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_tool_call(self, test_data_dir: Path, model: str, api_version: str, **kwargs): audio_file = test_data_dir / "4-1.wav" voicelive_openai_endpoint = kwargs.pop("voicelive_openai_endpoint") @@ -106,7 +106,7 @@ async def test_realtime_service_tool_call(self, test_data_dir: Path, model: str, @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4o", "gpt-5-chat"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_tool_choice(self, test_data_dir: Path, model: str, api_version: str, **kwargs): if "realtime" in model: pytest.skip("Tool choice is not supported in realtime models yet") @@ -201,7 +201,7 @@ async def test_realtime_service_tool_choice(self, test_data_dir: Path, model: st @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4.1", "gpt-5", "gpt-5.1", "gpt-5.2", "phi4-mm-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_tool_call_parameter( self, test_data_dir: Path, @@ -292,7 +292,7 @@ def get_weather(arguments: Union[str, Mapping[str, Any]]) -> str: @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.skip() @pytest.mark.parametrize("model", ["gpt-4o", "gpt-realtime"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_tool_call_no_audio_overlap( self, test_data_dir: Path, diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_transcription.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_transcription.py index 1c931dc3fd88..42ef971cd13f 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_transcription.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_transcription.py @@ -106,7 +106,7 @@ async def test_realtime_service_input_audio_transcription( "filler_word_24kHz.wav", ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_filler_word_removal( self, test_data_dir: Path, @@ -142,7 +142,7 @@ async def test_realtime_service_with_filler_word_removal( "filler_word_24kHz.wav", ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_filler_word_removal_multilingual( self, test_data_dir: Path, test_audio_file: str, api_version: str, **kwargs ): diff --git a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_turn_detection.py b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_turn_detection.py index c94f9c923d26..de3942861098 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_turn_detection.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/live/test_live_realtime_turn_detection.py @@ -55,7 +55,7 @@ class TestRealtimeServiceTurnDetection(AzureRecordedTestCase): ), ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_turn_detection_long_tts_vad_duration( self, test_data_dir: Path, model: str, server_sd_conf: dict, api_version: str, **kwargs ): @@ -101,7 +101,7 @@ async def test_realtime_service_with_turn_detection_long_tts_vad_duration( pytest.param("gpt-4o", {"languages": ["en", "es"]}, id="cascaded-realtime"), ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_turn_detection_multilingual( self, test_data_dir: Path, model: str, semantic_vad_params: dict, api_version: str, **kwargs ): @@ -149,7 +149,7 @@ async def test_realtime_service_with_turn_detection_multilingual( ), ], ) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_with_eou( self, test_data_dir: Path, @@ -185,7 +185,7 @@ async def test_realtime_service_with_eou( @VoiceLivePreparer() @pytest.mark.flaky(reruns=3, reruns_delay=2) @pytest.mark.parametrize("model", ["gpt-realtime", "gpt-4o", "phi4-mm-realtime", "phi4-mini"]) - @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-04-10"]) + @pytest.mark.parametrize("api_version", ["2025-10-01", "2026-07-15"]) async def test_realtime_service_wo_turn_detection( self, test_data_dir: Path, diff --git a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_client_events.py b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_client_events.py index f6fe4a031e31..5d3e60aa4ed5 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_client_events.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_client_events.py @@ -20,7 +20,6 @@ ClientEventResponseCancel, ClientEventInputTextDelta, ClientEventInputTextDone, - ClientEventRtcCallSdpCreate, # Event Types ClientEventType, # Supporting Models @@ -42,7 +41,7 @@ class TestClientEventSessionUpdate: def test_create_session_update_with_request_session(self): """Test creating session update with RequestSession object.""" session = RequestSession( - model="gpt-4o-realtime-preview", + model="gpt-realtime", modalities=[Modality.TEXT, Modality.AUDIO], voice=OpenAIVoice(name=OpenAIVoiceName.ALLOY), temperature=0.7, @@ -56,7 +55,7 @@ def test_create_session_update_with_request_session(self): def test_create_session_update_with_event_id(self): """Test creating session update with event ID.""" - session = RequestSession(model="gpt-4o-realtime-preview") + session = RequestSession(model="gpt-realtime") event_id = "session-update-123" event = ClientEventSessionUpdate(session=session, event_id=event_id) @@ -66,7 +65,7 @@ def test_create_session_update_with_event_id(self): def test_create_session_update_with_dict(self): """Test creating session update with dictionary session.""" - session_dict = {"model": "gpt-4o-realtime-preview", "modalities": ["text", "audio"], "temperature": 0.8} + session_dict = {"model": "gpt-realtime", "modalities": ["text", "audio"], "temperature": 0.8} event = ClientEventSessionUpdate(session=session_dict) @@ -250,30 +249,6 @@ def test_response_cancel_with_response_id(self): assert event.event_id == event_id -class TestClientEventRtcCall: - """Test RTC call client events.""" - - def test_rtc_call_sdp_create_basic(self): - """Test creating an RTC SDP offer event.""" - event = ClientEventRtcCallSdpCreate(sdp_offer="v=0\r\no=- 1 2 IN IP4 127.0.0.1") - - assert event.type == ClientEventType.RTC_CALL_SDP_CREATE - assert event.sdp_offer.startswith("v=0") - assert event.session is None - - def test_rtc_call_sdp_create_with_session(self): - """Test creating an RTC SDP offer event with an initial session.""" - session = RequestSession(model="gpt-4o-realtime-preview", modalities=[Modality.AUDIO]) - event = ClientEventRtcCallSdpCreate( - sdp_offer="v=0\r\no=- 1 2 IN IP4 127.0.0.1", - session=session, - event_id="rtc-evt-1", - ) - - assert event.event_id == "rtc-evt-1" - assert event.session == session - - class TestClientEventInputText: """Test streaming text input client events.""" @@ -302,7 +277,7 @@ class TestClientEventSerialization: def test_session_update_dict_access(self): """Test that session update events support dict-like access.""" - session = RequestSession(model="gpt-4o-realtime-preview") + session = RequestSession(model="gpt-realtime") event = ClientEventSessionUpdate(session=session) # Test that the event has expected attributes @@ -339,7 +314,7 @@ def test_complete_conversation_flow(self): """Test a complete conversation flow with multiple events.""" # Session update session = RequestSession( - model="gpt-4o-realtime-preview", + model="gpt-realtime", modalities=[Modality.TEXT, Modality.AUDIO], voice=OpenAIVoice(name=OpenAIVoiceName.SHIMMER), ) diff --git a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_connection.py b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_connection.py index 8ddfc283c702..ec121ca6a57d 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_connection.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_connection.py @@ -69,7 +69,7 @@ def setup_method(self): @pytest.mark.asyncio async def test_session_update_with_request_session(self): """Test session update with RequestSession object.""" - session = RequestSession(model="gpt-4o-realtime-preview", modalities=[Modality.TEXT, Modality.AUDIO]) + session = RequestSession(model="gpt-realtime", modalities=[Modality.TEXT, Modality.AUDIO]) await self.session_resource.update(session=session) @@ -81,7 +81,7 @@ async def test_session_update_with_request_session(self): @pytest.mark.asyncio async def test_session_update_with_mapping(self): """Test session update with dictionary mapping.""" - session_dict = {"model": "gpt-4o-realtime-preview", "modalities": ["text", "audio"], "temperature": 0.7} + session_dict = {"model": "gpt-realtime", "modalities": ["text", "audio"], "temperature": 0.7} await self.session_resource.update(session=session_dict) @@ -93,7 +93,7 @@ async def test_session_update_with_mapping(self): @pytest.mark.asyncio async def test_session_update_with_event_id(self): """Test session update with event ID.""" - session = RequestSession(model="gpt-4o-realtime-preview") + session = RequestSession(model="gpt-realtime") event_id = "test-event-123" await self.session_resource.update(session=session, event_id=event_id) @@ -249,7 +249,7 @@ async def test_send_message_flow(self): connection = VoiceLiveConnection(endpoint, credential) # Test session update - session = RequestSession(model="gpt-4o-realtime-preview", voice=OpenAIVoice(name=OpenAIVoiceName.ALLOY)) + session = RequestSession(model="gpt-realtime", voice=OpenAIVoice(name=OpenAIVoiceName.ALLOY)) # Mock the send method connection.send = AsyncMock() @@ -278,7 +278,7 @@ async def test_session_and_response_interaction(self): response_resource = ResponseResource(self.mock_connection) # Update session - session = RequestSession(model="gpt-4o-realtime-preview", temperature=0.8) + session = RequestSession(model="gpt-realtime", temperature=0.8) await session_resource.update(session=session) # Create response @@ -293,11 +293,11 @@ async def test_multiple_session_updates(self): session_resource = SessionResource(self.mock_connection) # First update - session1 = RequestSession(model="gpt-4o-realtime-preview") + session1 = RequestSession(model="gpt-realtime") await session_resource.update(session=session1, event_id="update-1") # Second update - session2 = RequestSession(model="gpt-4o-realtime-preview", temperature=0.5) + session2 = RequestSession(model="gpt-realtime", temperature=0.5) await session_resource.update(session=session2, event_id="update-2") # Verify both updates were sent @@ -333,7 +333,7 @@ async def test_connection_send_failure(self): session_resource = SessionResource(self.mock_connection) with pytest.raises(ConnectionError): - session = RequestSession(model="gpt-4o-realtime-preview") + session = RequestSession(model="gpt-realtime") await session_resource.update(session=session) @pytest.mark.asyncio @@ -671,7 +671,7 @@ def test_url_includes_api_version(self): manager = _VoiceLiveConnectionManager( credential=self.credential, endpoint="https://test.azure.com", - api_version="2026-04-10", + api_version="2026-07-15", agent_config=agent_config, extra_query={}, extra_headers={}, @@ -679,7 +679,7 @@ def test_url_includes_api_version(self): url = manager._prepare_url() - assert "api-version=2026-04-10" in url + assert "api-version=2026-07-15" in url def test_url_uses_default_api_version(self): """Test that URL uses the current SDK default API version when none is provided.""" @@ -698,4 +698,4 @@ def test_url_uses_default_api_version(self): url = manager._prepare_url() - assert "api-version=2026-06-01-preview" in url + assert "api-version=2026-07-15" in url diff --git a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_enums.py b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_enums.py index 1e4f647cd7fd..b21c6c3f9e27 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_enums.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_enums.py @@ -119,10 +119,6 @@ def test_response_events(self): assert ClientEventType.RESPONSE_CREATE == "response.create" assert ClientEventType.RESPONSE_CANCEL == "response.cancel" - def test_rtc_call_events(self): - """Test RTC call events.""" - assert ClientEventType.RTC_CALL_SDP_CREATE == "rtc.call.sdp.create" - def test_input_text_events(self): """Test input text streaming events.""" assert ClientEventType.INPUT_TEXT_DELTA == "input_text.delta" @@ -312,14 +308,8 @@ def test_file_search_events(self): def test_output_audio_buffer_cleared(self): assert ServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED == "output_audio_buffer.cleared" - def test_output_audio_buffer_lifecycle(self): - assert ServerEventType.OUTPUT_AUDIO_BUFFER_STARTED == "output_audio_buffer.started" - assert ServerEventType.OUTPUT_AUDIO_BUFFER_STOPPED == "output_audio_buffer.stopped" - def test_invocation_and_rtc_events(self): assert ServerEventType.RESPONSE_INVOCATION_DELTA == "response.invocation.delta" - assert ServerEventType.RTC_CALL_SDP_CREATED == "rtc.call.sdp.created" - assert ServerEventType.RTC_CALL_ERROR == "rtc.call.error" def test_audio_transcript_annotation(self): assert ( diff --git a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_integration.py b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_integration.py index 30d7d707daac..800ff83aa194 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_integration.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_integration.py @@ -204,9 +204,9 @@ def test_api_version_update_compatibility(self): from azure.ai.voicelive.models import RequestSession, OpenAIVoice, OpenAIVoiceName # Test that session creation still works - session = RequestSession(model="gpt-4o-realtime-preview", voice=OpenAIVoice(name=OpenAIVoiceName.ALLOY)) + session = RequestSession(model="gpt-realtime", voice=OpenAIVoice(name=OpenAIVoiceName.ALLOY)) - assert session.model == "gpt-4o-realtime-preview" + assert session.model == "gpt-realtime" assert session.voice.name == OpenAIVoiceName.ALLOY diff --git a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_models.py b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_models.py index 0b90d204a33a..d4a8fe1a18c3 100644 --- a/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_models.py +++ b/sdk/voicelive/azure-ai-voicelive/tests/unit/test_unit_models.py @@ -19,7 +19,6 @@ AzureStandardVoice, AzureVoiceType, EchoCancellationReferenceSource, - EouThresholdLevel, FileSearchResult, InputAudioContentPart, InputTextContentPart, @@ -46,20 +45,14 @@ ResponseMCPListToolItem, ResponseSession, ResponseWebSearchCallItem, - RtcCallErrorDetails, ServerEventMcpListToolsCompleted, ServerEventMcpListToolsFailed, ServerEventMcpListToolsInProgress, - ServerEventOutputAudioBufferStarted, - ServerEventOutputAudioBufferStopped, ServerEventResponseInvocationDelta, ServerEventResponseMcpCallArgumentsDelta, ServerEventResponseMcpCallArgumentsDone, - ServerEventRtcCallError, - ServerEventRtcCallSdpCreated, ServerEventType, ServerVad, - SmartEndOfTurnDetection, SystemMessageItem, ToolType, TranscriptionPhrase, @@ -392,26 +385,6 @@ def test_request_session_with_explicit_echo_cancellation_settings(self): assert session.input_audio_echo_cancellation.channels == 1 -class TestEndOfTurnDetectionModels: - """Test smart end-of-turn detection models.""" - - def test_smart_end_of_turn_detection_basic(self): - """Test SmartEndOfTurnDetection model.""" - detection = SmartEndOfTurnDetection(threshold_level=EouThresholdLevel.MEDIUM, timeout_ms=750) - - assert detection.model == "smart_end_of_turn_detection" - assert detection.threshold_level == EouThresholdLevel.MEDIUM - assert detection.timeout_ms == 750 - - def test_server_vad_with_smart_end_of_turn_detection(self): - """Test ServerVad using SmartEndOfTurnDetection.""" - detection = SmartEndOfTurnDetection(threshold_level=EouThresholdLevel.HIGH, timeout_ms=1000) - turn_detection = ServerVad(end_of_utterance_detection=detection) - - assert turn_detection.end_of_utterance_detection is not None - assert turn_detection.end_of_utterance_detection.model == "smart_end_of_turn_detection" - - class TestMCPModels: """Test MCP (Model Context Protocol) related models.""" @@ -854,22 +827,6 @@ def test_server_event_response_mcp_call_arguments_done_with_full_arguments(self) class TestRealtimeAndRtcServerEvents: """Test realtime playback and RTC server event models.""" - def test_server_event_output_audio_buffer_started(self): - """Test output audio buffer started event.""" - event = ServerEventOutputAudioBufferStarted(event_id="evt-1", response_id="resp-123") - - assert event.type == ServerEventType.OUTPUT_AUDIO_BUFFER_STARTED - assert event.event_id == "evt-1" - assert event.response_id == "resp-123" - - def test_server_event_output_audio_buffer_stopped(self): - """Test output audio buffer stopped event.""" - event = ServerEventOutputAudioBufferStopped(event_id="evt-2", response_id="resp-456") - - assert event.type == ServerEventType.OUTPUT_AUDIO_BUFFER_STOPPED - assert event.event_id == "evt-2" - assert event.response_id == "resp-456" - def test_server_event_response_invocation_delta(self): """Test hosted agent invocation delta event.""" delta = {"type": "trace", "message": "partial hosted agent event"} @@ -879,34 +836,6 @@ def test_server_event_response_invocation_delta(self): assert event.event_id == "evt-3" assert event.delta == delta - def test_server_event_rtc_call_sdp_created(self): - """Test RTC SDP created event.""" - event = ServerEventRtcCallSdpCreated( - event_id="evt-4", - rtc_call_id="rtc-123", - sdp_answer="v=0\r\no=- 1 2 IN IP4 127.0.0.1", - ) - - assert event.type == ServerEventType.RTC_CALL_SDP_CREATED - assert event.rtc_call_id == "rtc-123" - assert event.sdp_answer.startswith("v=0") - - def test_server_event_rtc_call_error(self): - """Test RTC call error event.""" - error = RtcCallErrorDetails(type="server_error", message="RTC negotiation failed", code="rtc_failed") - event = ServerEventRtcCallError( - error=error, - operation="rtc.call.sdp.create", - rtc_call_id="rtc-123", - event_id="evt-5", - ) - - assert event.type == ServerEventType.RTC_CALL_ERROR - assert event.error.code == "rtc_failed" - assert event.error.message == "RTC negotiation failed" - assert event.operation == "rtc.call.sdp.create" - assert event.rtc_call_id == "rtc-123" - class TestMCPApprovalType: """Test MCPApprovalType enum."""