diff --git a/sdk/voicelive/azure-ai-voicelive/_metadata.json b/sdk/voicelive/azure-ai-voicelive/_metadata.json index 13d955e1bd07..428fc49e5b0b 100644 --- a/sdk/voicelive/azure-ai-voicelive/_metadata.json +++ b/sdk/voicelive/azure-ai-voicelive/_metadata.json @@ -1,6 +1,6 @@ { - "apiVersion": "2026-07-15", + "apiVersion": "virtual-public-preview", "apiVersions": { - "VoiceLive": "2026-07-15" + "VoiceLive": "virtual-public-preview" } } \ No newline at end of file diff --git a/sdk/voicelive/azure-ai-voicelive/apiview-properties.json b/sdk/voicelive/azure-ai-voicelive/apiview-properties.json index a8182c31b7ce..28340a80527b 100644 --- a/sdk/voicelive/azure-ai-voicelive/apiview-properties.json +++ b/sdk/voicelive/azure-ai-voicelive/apiview-properties.json @@ -7,37 +7,39 @@ "azure.ai.voicelive.models.ActionSearchSource": "VoiceLive.ActionSearchSource", "azure.ai.voicelive.models.AgentConfig": "VoiceLive.AgentConfig", "azure.ai.voicelive.models.Animation": "VoiceLive.Animation", - "azure.ai.voicelive.models.ConversationRequestItem": "VoiceLive.ConversationRequestItem", - "azure.ai.voicelive.models.MessageItem": "VoiceLive.MessageItem", - "azure.ai.voicelive.models.AssistantMessageItem": "VoiceLive.AssistantMessageItem", + "azure.ai.voicelive.models.AssignedManagedIdentity": "VoiceLive.AssignedManagedIdentity", + "azure.ai.voicelive.models.MessageItem": "OpenAI.RealtimeConversationItemMessage", + "azure.ai.voicelive.models.AssistantMessageItem": "OpenAI.RealtimeConversationItemMessageAssistant", + "azure.ai.voicelive.models.AudioConfig": "VoiceLive.AudioConfig", "azure.ai.voicelive.models.AudioEchoCancellation": "VoiceLive.AudioEchoCancellation", + "azure.ai.voicelive.models.AudioFormat": "VoiceLive.AudioFormat", + "azure.ai.voicelive.models.AudioFormats": "OpenAI.RealtimeAudioFormats", + "azure.ai.voicelive.models.AudioFormatsAudioPcm": "OpenAI.RealtimeAudioFormatsAudioPcm", + "azure.ai.voicelive.models.AudioFormatsAudioPcma": "OpenAI.RealtimeAudioFormatsAudioPcma", + "azure.ai.voicelive.models.AudioFormatsAudioPcmu": "OpenAI.RealtimeAudioFormatsAudioPcmu", + "azure.ai.voicelive.models.AudioInputConfig": "VoiceLive.AudioInputConfig", "azure.ai.voicelive.models.AudioInputTranscriptionOptions": "VoiceLive.AudioInputTranscriptionOptions", "azure.ai.voicelive.models.AudioNoiseReduction": "VoiceLive.AudioNoiseReduction", + "azure.ai.voicelive.models.AudioOutputConfig": "VoiceLive.AudioOutputConfig", "azure.ai.voicelive.models.AvatarConfig": "VoiceLive.AvatarConfig", "azure.ai.voicelive.models.AzureVoice": "VoiceLive.AzureVoice", "azure.ai.voicelive.models.AzureAvatarVoiceSyncVoice": "VoiceLive.AzureAvatarVoiceSyncVoice", "azure.ai.voicelive.models.AzureCustomVoice": "VoiceLive.AzureCustomVoice", "azure.ai.voicelive.models.AzurePersonalVoice": "VoiceLive.AzurePersonalVoice", "azure.ai.voicelive.models.AzureRealtimeNativeVoice": "VoiceLive.AzureRealtimeNativeVoice", + "azure.ai.voicelive.models.AzureResponseItem": "VoiceLive.AzureResponseItem", "azure.ai.voicelive.models.EouDetection": "VoiceLive.EouDetection", "azure.ai.voicelive.models.AzureSemanticDetection": "VoiceLive.AzureSemanticDetection", "azure.ai.voicelive.models.AzureSemanticDetectionEn": "VoiceLive.AzureSemanticDetectionEn", "azure.ai.voicelive.models.AzureSemanticDetectionMultilingual": "VoiceLive.AzureSemanticDetectionMultilingual", - "azure.ai.voicelive.models.TurnDetection": "VoiceLive.TurnDetection", + "azure.ai.voicelive.models.TurnDetection": "OpenAI.RealtimeTurnDetection", "azure.ai.voicelive.models.AzureSemanticVad": "VoiceLive.AzureSemanticVad", "azure.ai.voicelive.models.AzureSemanticVadEn": "VoiceLive.AzureSemanticVadEn", "azure.ai.voicelive.models.AzureSemanticVadMultilingual": "VoiceLive.AzureSemanticVadMultilingual", "azure.ai.voicelive.models.AzureStandardVoice": "VoiceLive.AzureStandardVoice", "azure.ai.voicelive.models.Background": "VoiceLive.Background", - "azure.ai.voicelive.models.CachedTokenDetails": "VoiceLive.CachedTokenDetails", - "azure.ai.voicelive.models.ClientEvent": "VoiceLive.ClientEvent", - "azure.ai.voicelive.models.ClientEventConversationItemCreate": "VoiceLive.ClientEventConversationItemCreate", - "azure.ai.voicelive.models.ClientEventConversationItemDelete": "VoiceLive.ClientEventConversationItemDelete", - "azure.ai.voicelive.models.ClientEventConversationItemRetrieve": "VoiceLive.ClientEventConversationItemRetrieve", - "azure.ai.voicelive.models.ClientEventConversationItemTruncate": "VoiceLive.ClientEventConversationItemTruncate", - "azure.ai.voicelive.models.ClientEventInputAudioBufferAppend": "VoiceLive.ClientEventInputAudioBufferAppend", - "azure.ai.voicelive.models.ClientEventInputAudioBufferClear": "VoiceLive.ClientEventInputAudioBufferClear", - "azure.ai.voicelive.models.ClientEventInputAudioBufferCommit": "VoiceLive.ClientEventInputAudioBufferCommit", + "azure.ai.voicelive.models.ClientEvent": "OpenAI.RealtimeClientEvent", + "azure.ai.voicelive.models.ClientEventBYOMCredentialUpdate": "VoiceLive.ClientEventBYOMCredentialUpdate", "azure.ai.voicelive.models.ClientEventInputAudioClear": "VoiceLive.ClientEventInputAudioClear", "azure.ai.voicelive.models.ClientEventInputAudioTurnAppend": "VoiceLive.ClientEventInputAudioTurnAppend", "azure.ai.voicelive.models.ClientEventInputAudioTurnCancel": "VoiceLive.ClientEventInputAudioTurnCancel", @@ -45,161 +47,127 @@ "azure.ai.voicelive.models.ClientEventInputAudioTurnStart": "VoiceLive.ClientEventInputAudioTurnStart", "azure.ai.voicelive.models.ClientEventInputTextDelta": "VoiceLive.ClientEventInputTextDelta", "azure.ai.voicelive.models.ClientEventInputTextDone": "VoiceLive.ClientEventInputTextDone", - "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", "azure.ai.voicelive.models.ConversationItemBase": "VoiceLive.ConversationItemBase", "azure.ai.voicelive.models.ErrorResponse": "VoiceLive.ErrorResponse", "azure.ai.voicelive.models.FileSearchResult": "VoiceLive.FileSearchResult", - "azure.ai.voicelive.models.FunctionCallItem": "VoiceLive.FunctionCallItem", - "azure.ai.voicelive.models.FunctionCallOutputItem": "VoiceLive.FunctionCallOutputItem", - "azure.ai.voicelive.models.Tool": "VoiceLive.Tool", - "azure.ai.voicelive.models.FunctionTool": "VoiceLive.FunctionTool", + "azure.ai.voicelive.models.RealtimeConversationItem": "OpenAI.RealtimeConversationItem", + "azure.ai.voicelive.models.FunctionCallItem": "OpenAI.RealtimeConversationItemFunctionCall", + "azure.ai.voicelive.models.FunctionCallOutputItem": "OpenAI.RealtimeConversationItemFunctionCallOutput", + "azure.ai.voicelive.models.FunctionTool": "OpenAI.RealtimeFunctionTool", "azure.ai.voicelive.models.IceServer": "VoiceLive.IceServer", - "azure.ai.voicelive.models.MessageContentPart": "VoiceLive.MessageContentPart", - "azure.ai.voicelive.models.InputAudioContentPart": "VoiceLive.InputAudioContentPart", - "azure.ai.voicelive.models.InputTextContentPart": "VoiceLive.InputTextContentPart", - "azure.ai.voicelive.models.InputTokenDetails": "VoiceLive.InputTokenDetails", "azure.ai.voicelive.models.InterimResponseConfigBase": "VoiceLive.InterimResponseConfigBase", "azure.ai.voicelive.models.LlmInterimResponseConfig": "VoiceLive.LlmInterimResponseConfig", "azure.ai.voicelive.models.LogProbProperties": "VoiceLive.LogProbProperties", - "azure.ai.voicelive.models.MCPApprovalResponseRequestItem": "VoiceLive.MCPApprovalResponseRequestItem", - "azure.ai.voicelive.models.MCPServer": "VoiceLive.MCPServer", - "azure.ai.voicelive.models.MCPTool": "VoiceLive.MCPTool", + "azure.ai.voicelive.models.MCPError": "OpenAI.RealtimeMCPError", + "azure.ai.voicelive.models.MCPHTTPError": "OpenAI.RealtimeMCPHTTPError", + "azure.ai.voicelive.models.MCPListToolsTool": "OpenAI.MCPListToolsTool", + "azure.ai.voicelive.models.MCPListToolsToolAnnotations": "OpenAI.MCPListToolsToolAnnotations", + "azure.ai.voicelive.models.MCPListToolsToolInputSchema": "OpenAI.MCPListToolsToolInputSchema", + "azure.ai.voicelive.models.MCPProtocolError": "OpenAI.RealtimeMCPProtocolError", + "azure.ai.voicelive.models.MCPToolExecutionError": "OpenAI.RealtimeMCPToolExecutionError", + "azure.ai.voicelive.models.Metadata": "OpenAI.Metadata", "azure.ai.voicelive.models.OpenAIVoice": "VoiceLive.OpenAIVoice", - "azure.ai.voicelive.models.OutputTextContentPart": "VoiceLive.OutputTextContentPart", - "azure.ai.voicelive.models.OutputTokenDetails": "VoiceLive.OutputTokenDetails", - "azure.ai.voicelive.models.RequestAudioContentPart": "VoiceLive.RequestAudioContentPart", - "azure.ai.voicelive.models.RequestImageContentPart": "VoiceLive.RequestImageContentPart", + "azure.ai.voicelive.models.PcmaAudioFormat": "VoiceLive.PcmaAudioFormat", + "azure.ai.voicelive.models.PcmAudioFormat": "VoiceLive.PcmAudioFormat", + "azure.ai.voicelive.models.PcmuAudioFormat": "VoiceLive.PcmuAudioFormat", + "azure.ai.voicelive.models.RealtimeConversationItemMessageAssistantContent": "OpenAI.RealtimeConversationItemMessageAssistantContent", + "azure.ai.voicelive.models.RealtimeConversationItemMessageSystemContent": "OpenAI.RealtimeConversationItemMessageSystemContent", + "azure.ai.voicelive.models.RealtimeConversationItemMessageUserContent": "OpenAI.RealtimeConversationItemMessageUserContent", + "azure.ai.voicelive.models.RealtimeFunctionToolParameters": "OpenAI.RealtimeFunctionToolParameters", + "azure.ai.voicelive.models.RealtimeMCPApprovalRequest": "OpenAI.RealtimeMCPApprovalRequest", + "azure.ai.voicelive.models.RealtimeMCPApprovalResponse": "OpenAI.RealtimeMCPApprovalResponse", + "azure.ai.voicelive.models.RealtimeMCPListTools": "OpenAI.RealtimeMCPListTools", + "azure.ai.voicelive.models.RealtimeMCPToolCall": "OpenAI.RealtimeMCPToolCall", + "azure.ai.voicelive.models.RealtimeReasoning": "OpenAI.RealtimeReasoning", + "azure.ai.voicelive.models.RealtimeResponse": "OpenAI.RealtimeResponse", + "azure.ai.voicelive.models.RealtimeResponseUsage": "OpenAI.RealtimeResponseUsage", + "azure.ai.voicelive.models.RealtimeTurnDetectionServerVad": "OpenAI.RealtimeTurnDetectionServerVad", "azure.ai.voicelive.models.RequestSession": "VoiceLive.RequestSession", - "azure.ai.voicelive.models.RequestTextContentPart": "VoiceLive.RequestTextContentPart", "azure.ai.voicelive.models.Response": "VoiceLive.Response", - "azure.ai.voicelive.models.ResponseAudioContentPart": "VoiceLive.ResponseAudioContentPart", - "azure.ai.voicelive.models.ResponseStatusDetails": "VoiceLive.ResponseStatusDetails", - "azure.ai.voicelive.models.ResponseCancelledDetails": "VoiceLive.ResponseCancelledDetails", + "azure.ai.voicelive.models.ResponseAudio": "OpenAI.RealtimeResponseAudio", + "azure.ai.voicelive.models.ResponseAudioOutput": "OpenAI.RealtimeResponseAudioOutput", + "azure.ai.voicelive.models.ResponseCreateAudio": "VoiceLive.ResponseCreateAudio", "azure.ai.voicelive.models.ResponseCreateParams": "VoiceLive.ResponseCreateParams", - "azure.ai.voicelive.models.ResponseFailedDetails": "VoiceLive.ResponseFailedDetails", - "azure.ai.voicelive.models.ResponseItem": "VoiceLive.ResponseItem", "azure.ai.voicelive.models.ResponseFileSearchCallItem": "VoiceLive.ResponseFileSearchCallItem", - "azure.ai.voicelive.models.ResponseFunctionCallItem": "VoiceLive.ResponseFunctionCallItem", - "azure.ai.voicelive.models.ResponseFunctionCallOutputItem": "VoiceLive.ResponseFunctionCallOutputItem", - "azure.ai.voicelive.models.ResponseIncompleteDetails": "VoiceLive.ResponseIncompleteDetails", - "azure.ai.voicelive.models.ResponseMCPApprovalRequestItem": "VoiceLive.ResponseMCPApprovalRequestItem", - "azure.ai.voicelive.models.ResponseMCPApprovalResponseItem": "VoiceLive.ResponseMCPApprovalResponseItem", - "azure.ai.voicelive.models.ResponseMCPCallItem": "VoiceLive.ResponseMCPCallItem", - "azure.ai.voicelive.models.ResponseMCPListToolItem": "VoiceLive.ResponseMCPListToolItem", - "azure.ai.voicelive.models.ResponseMessageItem": "VoiceLive.ResponseMessageItem", "azure.ai.voicelive.models.ResponseSession": "VoiceLive.ResponseSession", - "azure.ai.voicelive.models.ResponseTextContentPart": "VoiceLive.ResponseTextContentPart", + "azure.ai.voicelive.models.ResponseStatusDetails": "OpenAI.RealtimeResponseStatusDetails", + "azure.ai.voicelive.models.ResponseStatusDetailsError": "OpenAI.RealtimeResponseStatusDetailsError", + "azure.ai.voicelive.models.ResponseUsageInputTokenDetails": "OpenAI.RealtimeResponseUsageInputTokenDetails", + "azure.ai.voicelive.models.ResponseUsageInputTokenDetailsCachedTokensDetails": "OpenAI.RealtimeResponseUsageInputTokenDetailsCachedTokensDetails", + "azure.ai.voicelive.models.ResponseUsageOutputTokenDetails": "OpenAI.RealtimeResponseUsageOutputTokenDetails", "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", - "azure.ai.voicelive.models.ServerEventConversationItemDeleted": "VoiceLive.ServerEventConversationItemDeleted", - "azure.ai.voicelive.models.ServerEventConversationItemInputAudioTranscriptionCompleted": "VoiceLive.ServerEventConversationItemInputAudioTranscriptionCompleted", - "azure.ai.voicelive.models.ServerEventConversationItemInputAudioTranscriptionDelta": "VoiceLive.ServerEventConversationItemInputAudioTranscriptionDelta", - "azure.ai.voicelive.models.ServerEventConversationItemInputAudioTranscriptionFailed": "VoiceLive.ServerEventConversationItemInputAudioTranscriptionFailed", - "azure.ai.voicelive.models.ServerEventConversationItemRetrieved": "VoiceLive.ServerEventConversationItemRetrieved", - "azure.ai.voicelive.models.ServerEventConversationItemTruncated": "VoiceLive.ServerEventConversationItemTruncated", - "azure.ai.voicelive.models.ServerEventError": "VoiceLive.ServerEventError", - "azure.ai.voicelive.models.ServerEventErrorDetails": "VoiceLive.ServerEventErrorDetails", - "azure.ai.voicelive.models.ServerEventInputAudioBufferCleared": "VoiceLive.ServerEventInputAudioBufferCleared", - "azure.ai.voicelive.models.ServerEventInputAudioBufferCommitted": "VoiceLive.ServerEventInputAudioBufferCommitted", - "azure.ai.voicelive.models.ServerEventInputAudioBufferSpeechStarted": "VoiceLive.ServerEventInputAudioBufferSpeechStarted", - "azure.ai.voicelive.models.ServerEventInputAudioBufferSpeechStopped": "VoiceLive.ServerEventInputAudioBufferSpeechStopped", - "azure.ai.voicelive.models.ServerEventMcpListToolsCompleted": "VoiceLive.ServerEventMcpListToolsCompleted", - "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.ServerEventResponseAnimationBlendshapeDelta": "VoiceLive.ServerEventResponseAnimationBlendshapeDelta", - "azure.ai.voicelive.models.ServerEventResponseAnimationBlendshapeDone": "VoiceLive.ServerEventResponseAnimationBlendshapeDone", - "azure.ai.voicelive.models.ServerEventResponseAnimationVisemeDelta": "VoiceLive.ServerEventResponseAnimationVisemeDelta", - "azure.ai.voicelive.models.ServerEventResponseAnimationVisemeDone": "VoiceLive.ServerEventResponseAnimationVisemeDone", - "azure.ai.voicelive.models.ServerEventResponseAudioDelta": "VoiceLive.ServerEventResponseAudioDelta", - "azure.ai.voicelive.models.ServerEventResponseAudioDone": "VoiceLive.ServerEventResponseAudioDone", + "azure.ai.voicelive.models.ServerEvent": "OpenAI.RealtimeServerEvent", + "azure.ai.voicelive.models.ServerEventBYOMCredentialUpdated": "VoiceLive.ServerEventBYOMCredentialUpdated", + "azure.ai.voicelive.models.ServerEventErrorDetails": "OpenAI.RealtimeServerEventErrorError", "azure.ai.voicelive.models.ServerEventResponseAudioTimestampDelta": "VoiceLive.ServerEventResponseAudioTimestampDelta", "azure.ai.voicelive.models.ServerEventResponseAudioTimestampDone": "VoiceLive.ServerEventResponseAudioTimestampDone", - "azure.ai.voicelive.models.ServerEventResponseAudioTranscriptAnnotationAdded": "VoiceLive.ServerEventResponseAudioTranscriptAnnotationAdded", - "azure.ai.voicelive.models.ServerEventResponseAudioTranscriptDelta": "VoiceLive.ServerEventResponseAudioTranscriptDelta", - "azure.ai.voicelive.models.ServerEventResponseAudioTranscriptDone": "VoiceLive.ServerEventResponseAudioTranscriptDone", - "azure.ai.voicelive.models.ServerEventResponseContentPartAdded": "VoiceLive.ServerEventResponseContentPartAdded", - "azure.ai.voicelive.models.ServerEventResponseContentPartDone": "VoiceLive.ServerEventResponseContentPartDone", - "azure.ai.voicelive.models.ServerEventResponseCreated": "VoiceLive.ServerEventResponseCreated", - "azure.ai.voicelive.models.ServerEventResponseDone": "VoiceLive.ServerEventResponseDone", "azure.ai.voicelive.models.ServerEventResponseFileSearchCallCompleted": "VoiceLive.ServerEventResponseFileSearchCallCompleted", "azure.ai.voicelive.models.ServerEventResponseFileSearchCallInProgress": "VoiceLive.ServerEventResponseFileSearchCallInProgress", "azure.ai.voicelive.models.ServerEventResponseFileSearchCallSearching": "VoiceLive.ServerEventResponseFileSearchCallSearching", - "azure.ai.voicelive.models.ServerEventResponseFunctionCallArgumentsDelta": "VoiceLive.ServerEventResponseFunctionCallArgumentsDelta", - "azure.ai.voicelive.models.ServerEventResponseFunctionCallArgumentsDone": "VoiceLive.ServerEventResponseFunctionCallArgumentsDone", "azure.ai.voicelive.models.ServerEventResponseInvocationDelta": "VoiceLive.ServerEventResponseInvocationDelta", - "azure.ai.voicelive.models.ServerEventResponseMcpCallArgumentsDelta": "VoiceLive.ServerEventResponseMcpCallArgumentsDelta", - "azure.ai.voicelive.models.ServerEventResponseMcpCallArgumentsDone": "VoiceLive.ServerEventResponseMcpCallArgumentsDone", - "azure.ai.voicelive.models.ServerEventResponseMcpCallCompleted": "VoiceLive.ServerEventResponseMcpCallCompleted", - "azure.ai.voicelive.models.ServerEventResponseMcpCallFailed": "VoiceLive.ServerEventResponseMcpCallFailed", - "azure.ai.voicelive.models.ServerEventResponseMcpCallInProgress": "VoiceLive.ServerEventResponseMcpCallInProgress", - "azure.ai.voicelive.models.ServerEventResponseOutputItemAdded": "VoiceLive.ServerEventResponseOutputItemAdded", - "azure.ai.voicelive.models.ServerEventResponseOutputItemDone": "VoiceLive.ServerEventResponseOutputItemDone", - "azure.ai.voicelive.models.ServerEventResponseTextDelta": "VoiceLive.ServerEventResponseTextDelta", - "azure.ai.voicelive.models.ServerEventResponseTextDone": "VoiceLive.ServerEventResponseTextDone", "azure.ai.voicelive.models.ServerEventResponseVideoDelta": "VoiceLive.ServerEventResponseVideoDelta", "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", - "azure.ai.voicelive.models.ServerEventSessionCreated": "VoiceLive.ServerEventSessionCreated", - "azure.ai.voicelive.models.ServerEventSessionUpdated": "VoiceLive.ServerEventSessionUpdated", "azure.ai.voicelive.models.ServerEventWarning": "VoiceLive.ServerEventWarning", "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", - "azure.ai.voicelive.models.ToolChoiceSelection": "VoiceLive.ToolChoiceObject", - "azure.ai.voicelive.models.ToolChoiceFunctionSelection": "VoiceLive.ToolChoiceFunctionObject", + "azure.ai.voicelive.models.SystemMessageItem": "OpenAI.RealtimeConversationItemMessageSystem", + "azure.ai.voicelive.models.ToolChoiceParam": "OpenAI.ToolChoiceParam", + "azure.ai.voicelive.models.ToolChoiceFunction": "OpenAI.ToolChoiceFunction", + "azure.ai.voicelive.models.ToolChoiceMCP": "OpenAI.ToolChoiceMCP", "azure.ai.voicelive.models.TranscriptionPhrase": "VoiceLive.TranscriptionPhrase", "azure.ai.voicelive.models.TranscriptionWord": "VoiceLive.TranscriptionWord", - "azure.ai.voicelive.models.UserMessageItem": "VoiceLive.UserMessageItem", + "azure.ai.voicelive.models.TurnDetectionSemanticVad": "OpenAI.RealtimeTurnDetectionSemanticVad", + "azure.ai.voicelive.models.UserMessageItem": "OpenAI.RealtimeConversationItemMessageUser", "azure.ai.voicelive.models.VideoCrop": "VoiceLive.VideoCrop", "azure.ai.voicelive.models.VideoParams": "VoiceLive.VideoParams", "azure.ai.voicelive.models.VideoResolution": "VoiceLive.VideoResolution", - "azure.ai.voicelive.models.VoiceLiveErrorDetails": "VoiceLive.VoiceLiveErrorDetails", - "azure.ai.voicelive.models.AnimationOutputType": "VoiceLive.AnimationOutputType", - "azure.ai.voicelive.models.OpenAIVoiceName": "VoiceLive.OAIVoice", - "azure.ai.voicelive.models.AzureVoiceType": "VoiceLive.AzureVoiceType", - "azure.ai.voicelive.models.PersonalVoiceModels": "VoiceLive.PersonalVoiceModels", - "azure.ai.voicelive.models.AzureRealtimeNativeVoiceName": "VoiceLive.AzureRealtimeNativeVoiceName", + "azure.ai.voicelive.models.VoiceAdaptation": "VoiceLive.VoiceAdaptation", + "azure.ai.voicelive.models.VoiceLiveMcpApprovalRules": "VoiceLive.VoiceLiveMcpApprovalRules", + "azure.ai.voicelive.models.VoiceLiveMcpTool": "VoiceLive.VoiceLiveMcpTool", + "azure.ai.voicelive.models.RealtimeClientEventType": "OpenAI.RealtimeClientEventType", + "azure.ai.voicelive.models.SessionModality": "VoiceLive.SessionModality", + "azure.ai.voicelive.models.AudioFormatType": "VoiceLive.AudioFormatType", + "azure.ai.voicelive.models.TurnDetectionType": "OpenAI.RealtimeTurnDetectionType", "azure.ai.voicelive.models.EouThresholdLevel": "VoiceLive.EouThresholdLevel", - "azure.ai.voicelive.models.TurnDetectionType": "VoiceLive.TurnDetectionType", "azure.ai.voicelive.models.EchoCancellationReferenceSource": "VoiceLive.EchoCancellationReferenceSource", + "azure.ai.voicelive.models.VoiceType": "VoiceLive.VoiceType", + "azure.ai.voicelive.models.AudioTimestampType": "VoiceLive.AudioTimestampType", + "azure.ai.voicelive.models.VoiceLiveMcpApprovalMode": "VoiceLive.VoiceLiveMcpApprovalMode", + "azure.ai.voicelive.models.McpResponseScheduling": "VoiceLive.McpResponseScheduling", + "azure.ai.voicelive.models.ToolChoiceOptions": "OpenAI.ToolChoiceOptions", + "azure.ai.voicelive.models.ToolChoiceParamType": "OpenAI.ToolChoiceParamType", + "azure.ai.voicelive.models.ReasoningEffort": "OpenAI.RealtimeReasoningEffort", + "azure.ai.voicelive.models.AnimationOutputType": "VoiceLive.AnimationOutputType", "azure.ai.voicelive.models.AvatarConfigTypes": "VoiceLive.AvatarConfigTypes", "azure.ai.voicelive.models.PhotoAvatarBaseModes": "VoiceLive.PhotoAvatarBaseModes", "azure.ai.voicelive.models.AvatarOutputProtocol": "VoiceLive.AvatarOutputProtocol", - "azure.ai.voicelive.models.ToolType": "VoiceLive.ToolType", - "azure.ai.voicelive.models.MCPApprovalType": "VoiceLive.MCPApprovalType", "azure.ai.voicelive.models.InterimResponseConfigType": "VoiceLive.InterimResponseConfigType", "azure.ai.voicelive.models.InterimResponseTrigger": "VoiceLive.InterimResponseTrigger", - "azure.ai.voicelive.models.Modality": "VoiceLive.Modality", - "azure.ai.voicelive.models.InputAudioFormat": "VoiceLive.InputAudioFormat", - "azure.ai.voicelive.models.OutputAudioFormat": "VoiceLive.OutputAudioFormat", - "azure.ai.voicelive.models.AudioTimestampType": "VoiceLive.AudioTimestampType", - "azure.ai.voicelive.models.ToolChoiceLiteral": "VoiceLive.ToolChoiceLiteral", - "azure.ai.voicelive.models.ReasoningEffort": "VoiceLive.ReasoningEffort", - "azure.ai.voicelive.models.SessionIncludeOption": "VoiceLive.SessionIncludeOption", - "azure.ai.voicelive.models.ClientEventType": "VoiceLive.ClientEventType", + "azure.ai.voicelive.models.RealtimeConversationItemMessageType": "OpenAI.RealtimeConversationItemMessageType", + "azure.ai.voicelive.models.RealtimeConversationItemType": "OpenAI.RealtimeConversationItemType", + "azure.ai.voicelive.models.McpErrorType": "OpenAI.RealtimeMcpErrorType", + "azure.ai.voicelive.models.ResponseConversation": "VoiceLive.ResponseConversation", "azure.ai.voicelive.models.ItemType": "VoiceLive.ItemType", - "azure.ai.voicelive.models.ItemParamStatus": "VoiceLive.ItemParamStatus", - "azure.ai.voicelive.models.MessageRole": "VoiceLive.MessageRole", - "azure.ai.voicelive.models.ContentPartType": "VoiceLive.ContentPartType", - "azure.ai.voicelive.models.ResponseStatus": "VoiceLive.ResponseStatus", - "azure.ai.voicelive.models.RequestImageContentPartDetail": "VoiceLive.RequestImageContentPartDetail", - "azure.ai.voicelive.models.ResponseItemStatus": "VoiceLive.ResponseItemStatus", - "azure.ai.voicelive.models.ServerEventType": "VoiceLive.ServerEventType" + "azure.ai.voicelive.models.AudioFormatsType": "OpenAI.RealtimeAudioFormatsType", + "azure.ai.voicelive.models.VoiceIdsShared": "OpenAI.VoiceIdsShared", + "azure.ai.voicelive.models.RealtimeServerEventType": "OpenAI.RealtimeServerEventType", + "azure.ai.voicelive.models.OpenAIVoiceName": "VoiceLive.OAIVoice", + "azure.ai.voicelive.models.AzureVoiceType": "VoiceLive.AzureVoiceType", + "azure.ai.voicelive.models.PersonalVoiceModels": "VoiceLive.PersonalVoiceModels", + "azure.ai.voicelive.models.AzureRealtimeNativeVoiceName": "VoiceLive.AzureRealtimeNativeVoiceName" }, - "CrossLanguageVersion": "e710d3387810" + "CrossLanguageVersion": "d1ce0f1c87a5" } \ 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 index ae3e380f7eaa..9609c54ff932 100644 --- a/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_unions.py +++ b/sdk/voicelive/azure-ai-voicelive/azure/ai/voicelive/_unions.py @@ -10,8 +10,24 @@ 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"] +VoiceLiveMcpAuthorization = Union[str, "_models.AssignedManagedIdentity"] +VoiceLiveMcpRequireApproval = Union[str, "_models.VoiceLiveMcpApprovalMode", "_models.VoiceLiveMcpApprovalRules"] +VoiceLiveTool = Union["_models.FunctionTool", "_models.VoiceLiveMcpTool"] +VoiceLiveToolChoice = Union[str, "_models.ToolChoiceOptions", "_models.ToolChoiceFunction", "_models.ToolChoiceMCP"] InterimResponseConfig = Union["_models.StaticInterimResponseConfig", "_models.LlmInterimResponseConfig"] +ConversationRequestItem = Union[ + "_models.MessageItem", + "_models.FunctionCallItem", + "_models.FunctionCallOutputItem", + "_models.RealtimeMCPApprovalResponse", +] +ResponseItem = Union[ + "_models.AzureResponseItem", + "_models.MessageItem", + "_models.FunctionCallItem", + "_models.FunctionCallOutputItem", + "_models.RealtimeMCPToolCall", + "_models.RealtimeMCPListTools", + "_models.RealtimeMCPApprovalRequest", + "_models.RealtimeMCPApprovalResponse", +] 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 b93f5120d517..0f2c5bdfe70f 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 @@ -458,21 +458,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -482,7 +482,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -517,19 +517,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -542,10 +542,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: 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 b4d6f8d36d6b..9ae3aa818b2f 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 @@ -20,15 +20,25 @@ ActionSearchSource, AgentConfig, Animation, + AssignedManagedIdentity, AssistantMessageItem, + AudioConfig, AudioEchoCancellation, + AudioFormat, + AudioFormats, + AudioFormatsAudioPcm, + AudioFormatsAudioPcma, + AudioFormatsAudioPcmu, + AudioInputConfig, AudioInputTranscriptionOptions, AudioNoiseReduction, + AudioOutputConfig, AvatarConfig, AzureAvatarVoiceSyncVoice, AzureCustomVoice, AzurePersonalVoice, AzureRealtimeNativeVoice, + AzureResponseItem, AzureSemanticDetection, AzureSemanticDetectionEn, AzureSemanticDetectionMultilingual, @@ -38,15 +48,8 @@ AzureStandardVoice, AzureVoice, Background, - CachedTokenDetails, ClientEvent, - ClientEventConversationItemCreate, - ClientEventConversationItemDelete, - ClientEventConversationItemRetrieve, - ClientEventConversationItemTruncate, - ClientEventInputAudioBufferAppend, - ClientEventInputAudioBufferClear, - ClientEventInputAudioBufferCommit, + ClientEventBYOMCredentialUpdate, ClientEventInputAudioClear, ClientEventInputAudioTurnAppend, ClientEventInputAudioTurnCancel, @@ -54,14 +57,9 @@ ClientEventInputAudioTurnStart, ClientEventInputTextDelta, ClientEventInputTextDone, - ClientEventOutputAudioBufferClear, - ClientEventResponseCancel, - ClientEventResponseCreate, + ClientEventRtcCallSdpCreate, ClientEventSessionAvatarConnect, - ClientEventSessionUpdate, - ContentPart, ConversationItemBase, - ConversationRequestItem, EouDetection, ErrorResponse, FileSearchResult, @@ -69,153 +67,123 @@ FunctionCallOutputItem, FunctionTool, IceServer, - InputAudioContentPart, - InputTextContentPart, - InputTokenDetails, InterimResponseConfigBase, LlmInterimResponseConfig, LogProbProperties, - MCPApprovalResponseRequestItem, - MCPServer, - MCPTool, - MessageContentPart, + MCPError, + MCPHTTPError, + MCPListToolsTool, + MCPListToolsToolAnnotations, + MCPListToolsToolInputSchema, + MCPProtocolError, + MCPToolExecutionError, MessageItem, + Metadata, OpenAIVoice, - OutputTextContentPart, - OutputTokenDetails, - RequestAudioContentPart, - RequestImageContentPart, + PcmAudioFormat, + PcmaAudioFormat, + PcmuAudioFormat, + RealtimeConversationItem, + RealtimeConversationItemMessageAssistantContent, + RealtimeConversationItemMessageSystemContent, + RealtimeConversationItemMessageUserContent, + RealtimeFunctionToolParameters, + RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, + RealtimeMCPListTools, + RealtimeMCPToolCall, + RealtimeReasoning, + RealtimeResponse, + RealtimeResponseUsage, + RealtimeTurnDetectionServerVad, RequestSession, - RequestTextContentPart, Response, - ResponseAudioContentPart, - ResponseCancelledDetails, + ResponseAudio, + ResponseAudioOutput, + ResponseCreateAudio, ResponseCreateParams, - ResponseFailedDetails, ResponseFileSearchCallItem, - ResponseFunctionCallItem, - ResponseFunctionCallOutputItem, - ResponseIncompleteDetails, - ResponseItem, - ResponseMCPApprovalRequestItem, - ResponseMCPApprovalResponseItem, - ResponseMCPCallItem, - ResponseMCPListToolItem, - ResponseMessageItem, ResponseSession, ResponseStatusDetails, - ResponseTextContentPart, + ResponseStatusDetailsError, + ResponseUsageInputTokenDetails, + ResponseUsageInputTokenDetailsCachedTokensDetails, + ResponseUsageOutputTokenDetails, ResponseWebSearchCallItem, + RtcCallErrorDetails, Scene, ServerEvent, - ServerEventConversationItemCreated, - ServerEventConversationItemDeleted, - ServerEventConversationItemInputAudioTranscriptionCompleted, - ServerEventConversationItemInputAudioTranscriptionDelta, - ServerEventConversationItemInputAudioTranscriptionFailed, - ServerEventConversationItemRetrieved, - ServerEventConversationItemTruncated, - ServerEventError, + ServerEventBYOMCredentialUpdated, ServerEventErrorDetails, - ServerEventInputAudioBufferCleared, - ServerEventInputAudioBufferCommitted, - ServerEventInputAudioBufferSpeechStarted, - ServerEventInputAudioBufferSpeechStopped, - ServerEventMcpListToolsCompleted, - ServerEventMcpListToolsFailed, - ServerEventMcpListToolsInProgress, - ServerEventOutputAudioBufferCleared, - ServerEventResponseAnimationBlendshapeDelta, - ServerEventResponseAnimationBlendshapeDone, - ServerEventResponseAnimationVisemeDelta, - ServerEventResponseAnimationVisemeDone, - ServerEventResponseAudioDelta, - ServerEventResponseAudioDone, ServerEventResponseAudioTimestampDelta, ServerEventResponseAudioTimestampDone, - ServerEventResponseAudioTranscriptAnnotationAdded, - ServerEventResponseAudioTranscriptDelta, - ServerEventResponseAudioTranscriptDone, - ServerEventResponseContentPartAdded, - ServerEventResponseContentPartDone, - ServerEventResponseCreated, - ServerEventResponseDone, ServerEventResponseFileSearchCallCompleted, ServerEventResponseFileSearchCallInProgress, ServerEventResponseFileSearchCallSearching, - ServerEventResponseFunctionCallArgumentsDelta, - ServerEventResponseFunctionCallArgumentsDone, ServerEventResponseInvocationDelta, - ServerEventResponseMcpCallArgumentsDelta, - ServerEventResponseMcpCallArgumentsDone, - ServerEventResponseMcpCallCompleted, - ServerEventResponseMcpCallFailed, - ServerEventResponseMcpCallInProgress, - ServerEventResponseOutputItemAdded, - ServerEventResponseOutputItemDone, - ServerEventResponseTextDelta, - ServerEventResponseTextDone, ServerEventResponseVideoDelta, ServerEventResponseWebSearchCallCompleted, ServerEventResponseWebSearchCallInProgress, ServerEventResponseWebSearchCallSearching, + ServerEventRtcCallError, + ServerEventRtcCallSdpCreated, ServerEventSessionAvatarConnecting, ServerEventSessionAvatarSwitchToIdle, ServerEventSessionAvatarSwitchToSpeaking, - ServerEventSessionCreated, - ServerEventSessionUpdated, ServerEventWarning, ServerEventWarningDetails, - ServerVad, SessionBase, + SmartEndOfTurnDetection, StaticInterimResponseConfig, SystemMessageItem, - TokenUsage, - Tool, - ToolChoiceFunctionSelection, - ToolChoiceSelection, + ToolChoiceFunction, + ToolChoiceMCP, + ToolChoiceParam, TranscriptionPhrase, TranscriptionWord, TurnDetection, + TurnDetectionSemanticVad, UserMessageItem, VideoCrop, VideoParams, VideoResolution, - VoiceLiveErrorDetails, + VoiceAdaptation, + VoiceLiveMcpApprovalRules, + VoiceLiveMcpTool, ) from ._enums import ( # type: ignore AnimationOutputType, + AudioFormatType, + AudioFormatsType, AudioTimestampType, AvatarConfigTypes, AvatarOutputProtocol, AzureRealtimeNativeVoiceName, AzureVoiceType, - ClientEventType, - ContentPartType, EchoCancellationReferenceSource, EouThresholdLevel, - InputAudioFormat, InterimResponseConfigType, InterimResponseTrigger, - ItemParamStatus, ItemType, - MCPApprovalType, - MessageRole, - Modality, + McpErrorType, + McpResponseScheduling, OpenAIVoiceName, - OutputAudioFormat, PersonalVoiceModels, PhotoAvatarBaseModes, + RealtimeClientEventType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + RealtimeServerEventType, ReasoningEffort, - RequestImageContentPartDetail, - ResponseItemStatus, - ResponseStatus, - ServerEventType, - SessionIncludeOption, - ToolChoiceLiteral, - ToolType, + ResponseConversation, + SessionModality, + ToolChoiceOptions, + ToolChoiceParamType, TurnDetectionType, + VoiceIdsShared, + VoiceLiveMcpApprovalMode, + VoiceType, ) from ._patch import __all__ as _patch_all from ._patch import * @@ -228,15 +196,25 @@ "ActionSearchSource", "AgentConfig", "Animation", + "AssignedManagedIdentity", "AssistantMessageItem", + "AudioConfig", "AudioEchoCancellation", + "AudioFormat", + "AudioFormats", + "AudioFormatsAudioPcm", + "AudioFormatsAudioPcma", + "AudioFormatsAudioPcmu", + "AudioInputConfig", "AudioInputTranscriptionOptions", "AudioNoiseReduction", + "AudioOutputConfig", "AvatarConfig", "AzureAvatarVoiceSyncVoice", "AzureCustomVoice", "AzurePersonalVoice", "AzureRealtimeNativeVoice", + "AzureResponseItem", "AzureSemanticDetection", "AzureSemanticDetectionEn", "AzureSemanticDetectionMultilingual", @@ -246,15 +224,8 @@ "AzureStandardVoice", "AzureVoice", "Background", - "CachedTokenDetails", "ClientEvent", - "ClientEventConversationItemCreate", - "ClientEventConversationItemDelete", - "ClientEventConversationItemRetrieve", - "ClientEventConversationItemTruncate", - "ClientEventInputAudioBufferAppend", - "ClientEventInputAudioBufferClear", - "ClientEventInputAudioBufferCommit", + "ClientEventBYOMCredentialUpdate", "ClientEventInputAudioClear", "ClientEventInputAudioTurnAppend", "ClientEventInputAudioTurnCancel", @@ -262,14 +233,9 @@ "ClientEventInputAudioTurnStart", "ClientEventInputTextDelta", "ClientEventInputTextDone", - "ClientEventOutputAudioBufferClear", - "ClientEventResponseCancel", - "ClientEventResponseCreate", + "ClientEventRtcCallSdpCreate", "ClientEventSessionAvatarConnect", - "ClientEventSessionUpdate", - "ContentPart", "ConversationItemBase", - "ConversationRequestItem", "EouDetection", "ErrorResponse", "FileSearchResult", @@ -277,150 +243,120 @@ "FunctionCallOutputItem", "FunctionTool", "IceServer", - "InputAudioContentPart", - "InputTextContentPart", - "InputTokenDetails", "InterimResponseConfigBase", "LlmInterimResponseConfig", "LogProbProperties", - "MCPApprovalResponseRequestItem", - "MCPServer", - "MCPTool", - "MessageContentPart", + "MCPError", + "MCPHTTPError", + "MCPListToolsTool", + "MCPListToolsToolAnnotations", + "MCPListToolsToolInputSchema", + "MCPProtocolError", + "MCPToolExecutionError", "MessageItem", + "Metadata", "OpenAIVoice", - "OutputTextContentPart", - "OutputTokenDetails", - "RequestAudioContentPart", - "RequestImageContentPart", + "PcmAudioFormat", + "PcmaAudioFormat", + "PcmuAudioFormat", + "RealtimeConversationItem", + "RealtimeConversationItemMessageAssistantContent", + "RealtimeConversationItemMessageSystemContent", + "RealtimeConversationItemMessageUserContent", + "RealtimeFunctionToolParameters", + "RealtimeMCPApprovalRequest", + "RealtimeMCPApprovalResponse", + "RealtimeMCPListTools", + "RealtimeMCPToolCall", + "RealtimeReasoning", + "RealtimeResponse", + "RealtimeResponseUsage", + "RealtimeTurnDetectionServerVad", "RequestSession", - "RequestTextContentPart", "Response", - "ResponseAudioContentPart", - "ResponseCancelledDetails", + "ResponseAudio", + "ResponseAudioOutput", + "ResponseCreateAudio", "ResponseCreateParams", - "ResponseFailedDetails", "ResponseFileSearchCallItem", - "ResponseFunctionCallItem", - "ResponseFunctionCallOutputItem", - "ResponseIncompleteDetails", - "ResponseItem", - "ResponseMCPApprovalRequestItem", - "ResponseMCPApprovalResponseItem", - "ResponseMCPCallItem", - "ResponseMCPListToolItem", - "ResponseMessageItem", "ResponseSession", "ResponseStatusDetails", - "ResponseTextContentPart", + "ResponseStatusDetailsError", + "ResponseUsageInputTokenDetails", + "ResponseUsageInputTokenDetailsCachedTokensDetails", + "ResponseUsageOutputTokenDetails", "ResponseWebSearchCallItem", + "RtcCallErrorDetails", "Scene", "ServerEvent", - "ServerEventConversationItemCreated", - "ServerEventConversationItemDeleted", - "ServerEventConversationItemInputAudioTranscriptionCompleted", - "ServerEventConversationItemInputAudioTranscriptionDelta", - "ServerEventConversationItemInputAudioTranscriptionFailed", - "ServerEventConversationItemRetrieved", - "ServerEventConversationItemTruncated", - "ServerEventError", + "ServerEventBYOMCredentialUpdated", "ServerEventErrorDetails", - "ServerEventInputAudioBufferCleared", - "ServerEventInputAudioBufferCommitted", - "ServerEventInputAudioBufferSpeechStarted", - "ServerEventInputAudioBufferSpeechStopped", - "ServerEventMcpListToolsCompleted", - "ServerEventMcpListToolsFailed", - "ServerEventMcpListToolsInProgress", - "ServerEventOutputAudioBufferCleared", - "ServerEventResponseAnimationBlendshapeDelta", - "ServerEventResponseAnimationBlendshapeDone", - "ServerEventResponseAnimationVisemeDelta", - "ServerEventResponseAnimationVisemeDone", - "ServerEventResponseAudioDelta", - "ServerEventResponseAudioDone", "ServerEventResponseAudioTimestampDelta", "ServerEventResponseAudioTimestampDone", - "ServerEventResponseAudioTranscriptAnnotationAdded", - "ServerEventResponseAudioTranscriptDelta", - "ServerEventResponseAudioTranscriptDone", - "ServerEventResponseContentPartAdded", - "ServerEventResponseContentPartDone", - "ServerEventResponseCreated", - "ServerEventResponseDone", "ServerEventResponseFileSearchCallCompleted", "ServerEventResponseFileSearchCallInProgress", "ServerEventResponseFileSearchCallSearching", - "ServerEventResponseFunctionCallArgumentsDelta", - "ServerEventResponseFunctionCallArgumentsDone", "ServerEventResponseInvocationDelta", - "ServerEventResponseMcpCallArgumentsDelta", - "ServerEventResponseMcpCallArgumentsDone", - "ServerEventResponseMcpCallCompleted", - "ServerEventResponseMcpCallFailed", - "ServerEventResponseMcpCallInProgress", - "ServerEventResponseOutputItemAdded", - "ServerEventResponseOutputItemDone", - "ServerEventResponseTextDelta", - "ServerEventResponseTextDone", "ServerEventResponseVideoDelta", "ServerEventResponseWebSearchCallCompleted", "ServerEventResponseWebSearchCallInProgress", "ServerEventResponseWebSearchCallSearching", + "ServerEventRtcCallError", + "ServerEventRtcCallSdpCreated", "ServerEventSessionAvatarConnecting", "ServerEventSessionAvatarSwitchToIdle", "ServerEventSessionAvatarSwitchToSpeaking", - "ServerEventSessionCreated", - "ServerEventSessionUpdated", "ServerEventWarning", "ServerEventWarningDetails", - "ServerVad", "SessionBase", + "SmartEndOfTurnDetection", "StaticInterimResponseConfig", "SystemMessageItem", - "TokenUsage", - "Tool", - "ToolChoiceFunctionSelection", - "ToolChoiceSelection", + "ToolChoiceFunction", + "ToolChoiceMCP", + "ToolChoiceParam", "TranscriptionPhrase", "TranscriptionWord", "TurnDetection", + "TurnDetectionSemanticVad", "UserMessageItem", "VideoCrop", "VideoParams", "VideoResolution", - "VoiceLiveErrorDetails", + "VoiceAdaptation", + "VoiceLiveMcpApprovalRules", + "VoiceLiveMcpTool", "AnimationOutputType", + "AudioFormatType", + "AudioFormatsType", "AudioTimestampType", "AvatarConfigTypes", "AvatarOutputProtocol", "AzureRealtimeNativeVoiceName", "AzureVoiceType", - "ClientEventType", - "ContentPartType", "EchoCancellationReferenceSource", "EouThresholdLevel", - "InputAudioFormat", "InterimResponseConfigType", "InterimResponseTrigger", - "ItemParamStatus", "ItemType", - "MCPApprovalType", - "MessageRole", - "Modality", + "McpErrorType", + "McpResponseScheduling", "OpenAIVoiceName", - "OutputAudioFormat", "PersonalVoiceModels", "PhotoAvatarBaseModes", + "RealtimeClientEventType", + "RealtimeConversationItemMessageType", + "RealtimeConversationItemType", + "RealtimeServerEventType", "ReasoningEffort", - "RequestImageContentPartDetail", - "ResponseItemStatus", - "ResponseStatus", - "ServerEventType", - "SessionIncludeOption", - "ToolChoiceLiteral", - "ToolType", + "ResponseConversation", + "SessionModality", + "ToolChoiceOptions", + "ToolChoiceParamType", "TurnDetectionType", + "VoiceIdsShared", + "VoiceLiveMcpApprovalMode", + "VoiceType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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 bc0d282e0f12..9511f54952e3 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 @@ -19,6 +19,28 @@ class AnimationOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Viseme ID output type.""" +class AudioFormatsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of AudioFormatsType.""" + + AUDIO_PCM = "audio/pcm" + """AUDIO_PCM.""" + AUDIO_PCMU = "audio/pcmu" + """AUDIO_PCMU.""" + AUDIO_PCMA = "audio/pcma" + """AUDIO_PCMA.""" + + +class AudioFormatType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Audio format MIME types supported by VoiceLive v1.""" + + PCM = "audio/pcm" + """PCM.""" + PCMU = "audio/pcmu" + """PCMU.""" + PCMA = "audio/pcma" + """PCMA.""" + + class AudioTimestampType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Output timestamp types supported in audio response content.""" @@ -88,66 +110,6 @@ class AzureVoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Azure avatar voice sync.""" -class ClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Client event types used in VoiceLive protocol.""" - - SESSION_UPDATE = "session.update" - """SESSION_UPDATE.""" - INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" - """INPUT_AUDIO_BUFFER_APPEND.""" - INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" - """INPUT_AUDIO_BUFFER_COMMIT.""" - INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" - """INPUT_AUDIO_BUFFER_CLEAR.""" - INPUT_AUDIO_TURN_START = "input_audio.turn.start" - """INPUT_AUDIO_TURN_START.""" - INPUT_AUDIO_TURN_APPEND = "input_audio.turn.append" - """INPUT_AUDIO_TURN_APPEND.""" - INPUT_AUDIO_TURN_END = "input_audio.turn.end" - """INPUT_AUDIO_TURN_END.""" - INPUT_AUDIO_TURN_CANCEL = "input_audio.turn.cancel" - """INPUT_AUDIO_TURN_CANCEL.""" - INPUT_AUDIO_CLEAR = "input_audio.clear" - """INPUT_AUDIO_CLEAR.""" - CONVERSATION_ITEM_CREATE = "conversation.item.create" - """CONVERSATION_ITEM_CREATE.""" - CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" - """CONVERSATION_ITEM_RETRIEVE.""" - CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" - """CONVERSATION_ITEM_TRUNCATE.""" - CONVERSATION_ITEM_DELETE = "conversation.item.delete" - """CONVERSATION_ITEM_DELETE.""" - RESPONSE_CREATE = "response.create" - """RESPONSE_CREATE.""" - RESPONSE_CANCEL = "response.cancel" - """RESPONSE_CANCEL.""" - SESSION_AVATAR_CONNECT = "session.avatar.connect" - """SESSION_AVATAR_CONNECT.""" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - """MCP_APPROVAL_RESPONSE.""" - OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" - """Client request to clear the avatar output buffer.""" - INPUT_TEXT_DELTA = "input_text.delta" - """Streamed delta of input text content being appended to an item.""" - INPUT_TEXT_DONE = "input_text.done" - """Signals that the streamed input text content for an item is complete.""" - - -class ContentPartType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of ContentPartType.""" - - INPUT_TEXT = "input_text" - """INPUT_TEXT.""" - INPUT_AUDIO = "input_audio" - """INPUT_AUDIO.""" - INPUT_IMAGE = "input_image" - """INPUT_IMAGE.""" - TEXT = "text" - """TEXT.""" - AUDIO = "audio" - """AUDIO.""" - - class EchoCancellationReferenceSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The source of the echo cancellation reference signal.""" @@ -170,17 +132,6 @@ class EouThresholdLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Default sensitivity threshold level.""" -class InputAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Input audio format types supported.""" - - PCM16 = "pcm16" - """16-bit PCM audio format at default sampling rate (24kHz).""" - G711_ULAW = "g711_ulaw" - """G.711 μ-law (mu-law) audio format at 8kHz sampling rate.""" - G711_ALAW = "g711_alaw" - """G.711 A-law audio format at 8kHz sampling rate.""" - - class InterimResponseConfigType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Interim response configuration types.""" @@ -199,69 +150,37 @@ class InterimResponseTrigger(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Trigger interim response when a tool call is being executed.""" -class ItemParamStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the processing status of an item or parameter.""" - - COMPLETED = "completed" - """Item or parameter is still being processed.""" - INCOMPLETE = "incomplete" - """Item or parameter is not yet complete.""" - - class ItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of ItemType.""" - MESSAGE = "message" - """MESSAGE.""" - FUNCTION_CALL = "function_call" - """FUNCTION_CALL.""" - FUNCTION_CALL_OUTPUT = "function_call_output" - """FUNCTION_CALL_OUTPUT.""" - MCP_LIST_TOOLS = "mcp_list_tools" - """MCP_LIST_TOOLS.""" - MCP_CALL = "mcp_call" - """MCP_CALL.""" - MCP_APPROVAL_REQUEST = "mcp_approval_request" - """MCP_APPROVAL_REQUEST.""" - MCP_APPROVAL_RESPONSE = "mcp_approval_response" - """MCP_APPROVAL_RESPONSE.""" WEB_SEARCH_CALL = "web_search_call" """Web search call item.""" FILE_SEARCH_CALL = "file_search_call" """File search call item.""" -class MCPApprovalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The available set of MCP approval types.""" +class McpErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of McpErrorType.""" - NEVER = "never" - """Approval is never required.""" - ALWAYS = "always" - """Approval is always required.""" + PROTOCOL_ERROR = "protocol_error" + """PROTOCOL_ERROR.""" + TOOL_EXECUTION_ERROR = "tool_execution_error" + """TOOL_EXECUTION_ERROR.""" + HTTP_ERROR = "http_error" + """HTTP_ERROR.""" -class MessageRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of MessageRole.""" - - SYSTEM = "system" - """SYSTEM.""" - USER = "user" - """USER.""" - ASSISTANT = "assistant" - """ASSISTANT.""" +class McpResponseScheduling(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Response scheduling after locally executed MCP calls.""" - -class Modality(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Supported modalities for the session.""" - - TEXT = "text" - """Text modality.""" - AUDIO = "audio" - """Audio modality.""" - ANIMATION = "animation" - """Animation modality.""" - AVATAR = "avatar" - """Avatar modality.""" + SILENT = "silent" + """SILENT.""" + WHEN_IDLE = "when_idle" + """WHEN_IDLE.""" + INTERRUPT = "interrupt" + """INTERRUPT.""" + SKIP_IF_BUSY = "skip_if_busy" + """SKIP_IF_BUSY.""" class OpenAIVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -289,35 +208,6 @@ class OpenAIVoiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Cedar voice.""" -_LEGACY_OUTPUT_AUDIO_FORMAT_VALUES = { - "pcm16-8000hz": "pcm16_8000hz", - "pcm16-16000hz": "pcm16_16000hz", -} - - -class OutputAudioFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Output audio format types supported.""" - - PCM16 = "pcm16" - """16-bit PCM audio format at default sampling rate (24kHz).""" - PCM16_8000_HZ = "pcm16_8000hz" - """16-bit PCM audio format at 8kHz sampling rate.""" - PCM16_16000_HZ = "pcm16_16000hz" - """16-bit PCM audio format at 16kHz sampling rate.""" - G711_ULAW = "g711_ulaw" - """G.711 μ-law (mu-law) audio format at 8kHz sampling rate.""" - G711_ALAW = "g711_alaw" - """G.711 A-law audio format at 8kHz sampling rate.""" - - @classmethod - def _missing_(cls, value): - if isinstance(value, str): - current_value = _LEGACY_OUTPUT_AUDIO_FORMAT_VALUES.get(value.lower()) - if current_value is not None: - return cls(current_value) - return None - - class PersonalVoiceModels(str, Enum, metaclass=CaseInsensitiveEnumMeta): """PersonalVoice models.""" @@ -340,138 +230,140 @@ class PhotoAvatarBaseModes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """VASA-1 model.""" -class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Constrains effort on reasoning for reasoning models. Check model documentation for supported - values for each model. Reducing reasoning effort can result in faster responses and fewer - tokens used on reasoning in a response. - """ +class RealtimeClientEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeClientEventType.""" - NONE = "none" - """No reasoning effort.""" - MINIMAL = "minimal" - """Minimal reasoning effort.""" - LOW = "low" - """Low reasoning effort - faster responses with less reasoning.""" - MEDIUM = "medium" - """Medium reasoning effort - balanced between speed and reasoning depth.""" - HIGH = "high" - """High reasoning effort - more thorough reasoning, may take longer.""" - XHIGH = "xhigh" - """Extra high reasoning effort - maximum reasoning depth.""" - - -class RequestImageContentPartDetail(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies an image's detail level. Can be 'auto', 'low', 'high', or an unknown future value.""" - - AUTO = "auto" - """Automatically select an appropriate detail level.""" - LOW = "low" - """Use a lower detail level to reduce bandwidth or cost.""" - HIGH = "high" - """Use a higher detail level—potentially more resource-intensive.""" + CONVERSATION_ITEM_CREATE = "conversation.item.create" + """CONVERSATION_ITEM_CREATE.""" + CONVERSATION_ITEM_DELETE = "conversation.item.delete" + """CONVERSATION_ITEM_DELETE.""" + CONVERSATION_ITEM_RETRIEVE = "conversation.item.retrieve" + """CONVERSATION_ITEM_RETRIEVE.""" + CONVERSATION_ITEM_TRUNCATE = "conversation.item.truncate" + """CONVERSATION_ITEM_TRUNCATE.""" + INPUT_AUDIO_BUFFER_APPEND = "input_audio_buffer.append" + """INPUT_AUDIO_BUFFER_APPEND.""" + INPUT_AUDIO_BUFFER_CLEAR = "input_audio_buffer.clear" + """INPUT_AUDIO_BUFFER_CLEAR.""" + OUTPUT_AUDIO_BUFFER_CLEAR = "output_audio_buffer.clear" + """OUTPUT_AUDIO_BUFFER_CLEAR.""" + INPUT_AUDIO_BUFFER_COMMIT = "input_audio_buffer.commit" + """INPUT_AUDIO_BUFFER_COMMIT.""" + RESPONSE_CANCEL = "response.cancel" + """RESPONSE_CANCEL.""" + RESPONSE_CREATE = "response.create" + """RESPONSE_CREATE.""" + SESSION_UPDATE = "session.update" + """SESSION_UPDATE.""" -class ResponseItemStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the processing status of a response item.""" +class RealtimeConversationItemMessageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemMessageType.""" - IN_PROGRESS = "in_progress" - """Item that is in progress.""" - COMPLETED = "completed" - """Item has been fully processed and is complete.""" - INCOMPLETE = "incomplete" - """Item has been processed but is incomplete.""" + SYSTEM = "system" + """SYSTEM.""" + USER = "user" + """USER.""" + ASSISTANT = "assistant" + """ASSISTANT.""" -class ResponseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Terminal status of a response.""" +class RealtimeConversationItemType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeConversationItemType.""" - COMPLETED = "completed" - """COMPLETED.""" - CANCELLED = "cancelled" - """CANCELLED.""" - FAILED = "failed" - """FAILED.""" - INCOMPLETE = "incomplete" - """INCOMPLETE.""" - IN_PROGRESS = "in_progress" - """IN_PROGRESS.""" + FUNCTION_CALL = "function_call" + """FUNCTION_CALL.""" + FUNCTION_CALL_OUTPUT = "function_call_output" + """FUNCTION_CALL_OUTPUT.""" + MCP_APPROVAL_RESPONSE = "mcp_approval_response" + """MCP_APPROVAL_RESPONSE.""" + MCP_LIST_TOOLS = "mcp_list_tools" + """MCP_LIST_TOOLS.""" + MCP_CALL = "mcp_call" + """MCP_CALL.""" + MCP_APPROVAL_REQUEST = "mcp_approval_request" + """MCP_APPROVAL_REQUEST.""" -class ServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Server event types used in VoiceLive protocol.""" +class RealtimeServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RealtimeServerEventType.""" - ERROR = "error" - """ERROR.""" - WARNING = "warning" - """WARNING.""" - SESSION_AVATAR_CONNECTING = "session.avatar.connecting" - """SESSION_AVATAR_CONNECTING.""" - SESSION_CREATED = "session.created" - """SESSION_CREATED.""" - SESSION_UPDATED = "session.updated" - """SESSION_UPDATED.""" + CONVERSATION_CREATED = "conversation.created" + """CONVERSATION_CREATED.""" + CONVERSATION_ITEM_CREATED = "conversation.item.created" + """CONVERSATION_ITEM_CREATED.""" + CONVERSATION_ITEM_DELETED = "conversation.item.deleted" + """CONVERSATION_ITEM_DELETED.""" CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED = "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_DELTA.""" CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED = "conversation.item.input_audio_transcription.failed" """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - CONVERSATION_ITEM_CREATED = "conversation.item.created" - """CONVERSATION_ITEM_CREATED.""" CONVERSATION_ITEM_RETRIEVED = "conversation.item.retrieved" """CONVERSATION_ITEM_RETRIEVED.""" CONVERSATION_ITEM_TRUNCATED = "conversation.item.truncated" """CONVERSATION_ITEM_TRUNCATED.""" - CONVERSATION_ITEM_DELETED = "conversation.item.deleted" - """CONVERSATION_ITEM_DELETED.""" - INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" - """INPUT_AUDIO_BUFFER_COMMITTED.""" + ERROR = "error" + """ERROR.""" INPUT_AUDIO_BUFFER_CLEARED = "input_audio_buffer.cleared" """INPUT_AUDIO_BUFFER_CLEARED.""" + INPUT_AUDIO_BUFFER_COMMITTED = "input_audio_buffer.committed" + """INPUT_AUDIO_BUFFER_COMMITTED.""" + INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED = "input_audio_buffer.dtmf_event_received" + """INPUT_AUDIO_BUFFER_DTMF_EVENT_RECEIVED.""" INPUT_AUDIO_BUFFER_SPEECH_STARTED = "input_audio_buffer.speech_started" """INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" INPUT_AUDIO_BUFFER_SPEECH_STOPPED = "input_audio_buffer.speech_stopped" """INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - RESPONSE_CREATED = "response.created" - """RESPONSE_CREATED.""" - RESPONSE_DONE = "response.done" - """RESPONSE_DONE.""" - RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" - """RESPONSE_OUTPUT_ITEM_ADDED.""" - RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" - """RESPONSE_OUTPUT_ITEM_DONE.""" + RATE_LIMITS_UPDATED = "rate_limits.updated" + """RATE_LIMITS_UPDATED.""" + RESPONSE_OUTPUT_AUDIO_DELTA = "response.output_audio.delta" + """RESPONSE_OUTPUT_AUDIO_DELTA.""" + RESPONSE_OUTPUT_AUDIO_DONE = "response.output_audio.done" + """RESPONSE_OUTPUT_AUDIO_DONE.""" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA = "response.output_audio_transcript.delta" + """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA.""" + RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE = "response.output_audio_transcript.done" + """RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE.""" RESPONSE_CONTENT_PART_ADDED = "response.content_part.added" """RESPONSE_CONTENT_PART_ADDED.""" RESPONSE_CONTENT_PART_DONE = "response.content_part.done" """RESPONSE_CONTENT_PART_DONE.""" - RESPONSE_TEXT_DELTA = "response.text.delta" - """RESPONSE_TEXT_DELTA.""" - RESPONSE_TEXT_DONE = "response.text.done" - """RESPONSE_TEXT_DONE.""" - RESPONSE_AUDIO_TRANSCRIPT_DELTA = "response.audio_transcript.delta" - """RESPONSE_AUDIO_TRANSCRIPT_DELTA.""" - RESPONSE_AUDIO_TRANSCRIPT_DONE = "response.audio_transcript.done" - """RESPONSE_AUDIO_TRANSCRIPT_DONE.""" - RESPONSE_AUDIO_DELTA = "response.audio.delta" - """RESPONSE_AUDIO_DELTA.""" - RESPONSE_AUDIO_DONE = "response.audio.done" - """RESPONSE_AUDIO_DONE.""" - RESPONSE_ANIMATION_BLENDSHAPES_DELTA = "response.animation_blendshapes.delta" - """RESPONSE_ANIMATION_BLENDSHAPES_DELTA.""" - RESPONSE_ANIMATION_BLENDSHAPES_DONE = "response.animation_blendshapes.done" - """RESPONSE_ANIMATION_BLENDSHAPES_DONE.""" - RESPONSE_AUDIO_TIMESTAMP_DELTA = "response.audio_timestamp.delta" - """RESPONSE_AUDIO_TIMESTAMP_DELTA.""" - RESPONSE_AUDIO_TIMESTAMP_DONE = "response.audio_timestamp.done" - """RESPONSE_AUDIO_TIMESTAMP_DONE.""" - RESPONSE_ANIMATION_VISEME_DELTA = "response.animation_viseme.delta" - """RESPONSE_ANIMATION_VISEME_DELTA.""" - RESPONSE_ANIMATION_VISEME_DONE = "response.animation_viseme.done" - """RESPONSE_ANIMATION_VISEME_DONE.""" + RESPONSE_CREATED = "response.created" + """RESPONSE_CREATED.""" + RESPONSE_DONE = "response.done" + """RESPONSE_DONE.""" RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA = "response.function_call_arguments.delta" """RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE = "response.function_call_arguments.done" """RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" + RESPONSE_OUTPUT_ITEM_ADDED = "response.output_item.added" + """RESPONSE_OUTPUT_ITEM_ADDED.""" + RESPONSE_OUTPUT_ITEM_DONE = "response.output_item.done" + """RESPONSE_OUTPUT_ITEM_DONE.""" + RESPONSE_OUTPUT_TEXT_DELTA = "response.output_text.delta" + """RESPONSE_OUTPUT_TEXT_DELTA.""" + RESPONSE_OUTPUT_TEXT_DONE = "response.output_text.done" + """RESPONSE_OUTPUT_TEXT_DONE.""" + SESSION_CREATED = "session.created" + """SESSION_CREATED.""" + SESSION_UPDATED = "session.updated" + """SESSION_UPDATED.""" + OUTPUT_AUDIO_BUFFER_STARTED = "output_audio_buffer.started" + """OUTPUT_AUDIO_BUFFER_STARTED.""" + OUTPUT_AUDIO_BUFFER_STOPPED = "output_audio_buffer.stopped" + """OUTPUT_AUDIO_BUFFER_STOPPED.""" + OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" + """OUTPUT_AUDIO_BUFFER_CLEARED.""" + CONVERSATION_ITEM_ADDED = "conversation.item.added" + """CONVERSATION_ITEM_ADDED.""" + CONVERSATION_ITEM_DONE = "conversation.item.done" + """CONVERSATION_ITEM_DONE.""" + INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED = "input_audio_buffer.timeout_triggered" + """INPUT_AUDIO_BUFFER_TIMEOUT_TRIGGERED.""" + CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT = "conversation.item.input_audio_transcription.segment" + """CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_SEGMENT.""" MCP_LIST_TOOLS_IN_PROGRESS = "mcp_list_tools.in_progress" """MCP_LIST_TOOLS_IN_PROGRESS.""" MCP_LIST_TOOLS_COMPLETED = "mcp_list_tools.completed" @@ -488,63 +380,89 @@ class ServerEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RESPONSE_MCP_CALL_COMPLETED.""" RESPONSE_MCP_CALL_FAILED = "response.mcp_call.failed" """RESPONSE_MCP_CALL_FAILED.""" - SESSION_AVATAR_SWITCH_TO_SPEAKING = "session.avatar.switch_to_speaking" - """Avatar switches to speaking state.""" - SESSION_AVATAR_SWITCH_TO_IDLE = "session.avatar.switch_to_idle" - """Avatar switches to idle state.""" - RESPONSE_VIDEO_DELTA = "response.video.delta" - """Delta update for avatar video frames.""" - RESPONSE_WEB_SEARCH_CALL_SEARCHING = "response.web_search_call.searching" - """Web search call is searching.""" - RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS = "response.web_search_call.in_progress" - """Web search call is in progress.""" - RESPONSE_WEB_SEARCH_CALL_COMPLETED = "response.web_search_call.completed" - """Web search call completed.""" - RESPONSE_FILE_SEARCH_CALL_SEARCHING = "response.file_search_call.searching" - """File search call is searching.""" - RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS = "response.file_search_call.in_progress" - """File search call is in progress.""" - RESPONSE_FILE_SEARCH_CALL_COMPLETED = "response.file_search_call.completed" - """File search call completed.""" - OUTPUT_AUDIO_BUFFER_CLEARED = "output_audio_buffer.cleared" - """Output audio buffer has been cleared.""" - RESPONSE_AUDIO_TRANSCRIPT_ANNOTATION_ADDED = "response.audio_transcript.annotation.added" - """Audio transcript annotation added.""" - RESPONSE_INVOCATION_DELTA = "response.invocation.delta" - """Invocation passthrough delta from hosted agent.""" -class SessionIncludeOption(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Options for what additional data to include in session responses.""" +class ReasoningEffort(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Constrains effort on reasoning for reasoning-capable Realtime models such as + ``gpt-realtime-2``. + """ - ITEM_INPUT_AUDIO_TRANSCRIPTION_LOGPROBS = "item.input_audio_transcription.logprobs" - """Include log probabilities for input audio transcription.""" - ITEM_INPUT_AUDIO_TRANSCRIPTION_PHRASES = "item.input_audio_transcription.phrases" - """Include phrase-level details for input audio transcription.""" - FILE_SEARCH_CALL_RESULTS = "file_search_call.results" - """Include file search call results.""" + MINIMAL = "minimal" + """MINIMAL.""" + LOW = "low" + """LOW.""" + MEDIUM = "medium" + """MEDIUM.""" + HIGH = "high" + """HIGH.""" + XHIGH = "xhigh" + """XHIGH.""" -class ToolChoiceLiteral(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The available set of mode-level, string literal tool_choice options for the voicelive endpoint.""" +class ResponseConversation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Conversation association for a generated response.""" AUTO = "auto" - """Specifies that the model should freely determine which tool or tools, if any, to call.""" + """AUTO.""" NONE = "none" - """Specifies that the model should call no tools whatsoever.""" + """NONE.""" + + +class SessionModality(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Output modalities supported by VoiceLive sessions.""" + + TEXT = "text" + """TEXT.""" + AUDIO = "audio" + """AUDIO.""" + ANIMATION = "animation" + """ANIMATION.""" + AVATAR = "avatar" + """AVATAR.""" + + +class ToolChoiceOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tool choice mode.""" + + NONE = "none" + """NONE.""" + AUTO = "auto" + """AUTO.""" REQUIRED = "required" - """Specifies that the model should call at least one tool.""" + """REQUIRED.""" -class ToolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The supported tool type discriminators for voicelive tools. Currently, only 'function' tools - are supported. - """ +class ToolChoiceParamType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of ToolChoiceParamType.""" + ALLOWED_TOOLS = "allowed_tools" + """ALLOWED_TOOLS.""" FUNCTION = "function" """FUNCTION.""" MCP = "mcp" """MCP.""" + CUSTOM = "custom" + """CUSTOM.""" + APPLY_PATCH = "apply_patch" + """APPLY_PATCH.""" + SHELL = "shell" + """SHELL.""" + FILE_SEARCH = "file_search" + """FILE_SEARCH.""" + WEB_SEARCH_PREVIEW = "web_search_preview" + """WEB_SEARCH_PREVIEW.""" + COMPUTER_USE_PREVIEW = "computer_use_preview" + """COMPUTER_USE_PREVIEW.""" + WEB_SEARCH_PREVIEW2025_03_11 = "web_search_preview_2025_03_11" + """WEB_SEARCH_PREVIEW2025_03_11.""" + IMAGE_GENERATION = "image_generation" + """IMAGE_GENERATION.""" + CODE_INTERPRETER = "code_interpreter" + """CODE_INTERPRETER.""" + COMPUTER = "computer" + """COMPUTER.""" + COMPUTER_USE = "computer_use" + """COMPUTER_USE.""" class TurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -552,9 +470,56 @@ class TurnDetectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVER_VAD = "server_vad" """SERVER_VAD.""" - AZURE_SEMANTIC_VAD = "azure_semantic_vad" - """AZURE_SEMANTIC_VAD.""" - AZURE_SEMANTIC_VAD_EN = "azure_semantic_vad_en" - """AZURE_SEMANTIC_VAD_EN.""" - AZURE_SEMANTIC_VAD_MULTILINGUAL = "azure_semantic_vad_multilingual" - """AZURE_SEMANTIC_VAD_MULTILINGUAL.""" + SEMANTIC_VAD = "semantic_vad" + """SEMANTIC_VAD.""" + + +class VoiceIdsShared(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of VoiceIdsShared.""" + + ALLOY = "alloy" + """ALLOY.""" + ASH = "ash" + """ASH.""" + BALLAD = "ballad" + """BALLAD.""" + CORAL = "coral" + """CORAL.""" + ECHO = "echo" + """ECHO.""" + SAGE = "sage" + """SAGE.""" + SHIMMER = "shimmer" + """SHIMMER.""" + VERSE = "verse" + """VERSE.""" + MARIN = "marin" + """MARIN.""" + CEDAR = "cedar" + """CEDAR.""" + + +class VoiceLiveMcpApprovalMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """MCP approval modes accepted by VoiceLive.""" + + NEVER_MODE = "never" + """NEVER_MODE.""" + ALWAYS_MODE = "always" + """ALWAYS_MODE.""" + + +class VoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Voice implementations available through VoiceLive.""" + + OPENAI = "openai" + """OPENAI.""" + AZURE_STANDARD = "azure-standard" + """AZURE_STANDARD.""" + AZURE_CUSTOM = "azure-custom" + """AZURE_CUSTOM.""" + AZURE_PERSONAL = "azure-personal" + """AZURE_PERSONAL.""" + AVATAR_VOICE_SYNC = "avatar-voice-sync" + """AVATAR_VOICE_SYNC.""" + AZURE_REALTIME_NATIVE = "azure-realtime-native" + """AZURE_REALTIME_NATIVE.""" 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 4bfe589dd5f2..3a28e66ed06a 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 @@ -13,15 +13,15 @@ from .._utils.model_base import Model as _Model, rest_discriminator, rest_field from ._enums import ( + AudioFormatType, + AudioFormatsType, AzureVoiceType, - ClientEventType, - ContentPartType, InterimResponseConfigType, ItemType, - MessageRole, - ResponseStatus, - ServerEventType, - ToolType, + McpErrorType, + RealtimeConversationItemMessageType, + RealtimeConversationItemType, + ToolChoiceParamType, TurnDetectionType, ) @@ -256,33 +256,29 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConversationRequestItem(_Model): - """Base for any response item; discriminated by ``type``. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FunctionCallItem, FunctionCallOutputItem, MCPApprovalResponseRequestItem, MessageItem +class AssignedManagedIdentity(_Model): + """Managed identity authorization for an MCP server. - :ivar type: Required. Known values are: "message", "function_call", "function_call_output", - "mcp_list_tools", "mcp_call", "mcp_approval_request", "mcp_approval_response", - "web_search_call", and "file_search_call". - :vartype type: str or ~azure.ai.voicelive.models.ItemType - :ivar id: - :vartype id: str + :ivar type: Required. Default value is "assigned_managed_identity". + :vartype type: str + :ivar audience: Required. + :vartype audience: str + :ivar client_id: + :vartype client_id: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"message\", \"function_call\", \"function_call_output\", - \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", \"mcp_approval_response\", - \"web_search_call\", and \"file_search_call\".""" - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal["assigned_managed_identity"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"assigned_managed_identity\".""" + audience: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + client_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - type: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin + audience: str, + client_id: Optional[str] = None, ) -> None: ... @overload @@ -294,49 +290,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["assigned_managed_identity"] = "assigned_managed_identity" -class MessageItem(ConversationRequestItem, discriminator="message"): - """A message item within a conversation. +class MessageItem(_Model): + """MessageItem. You probably want to use the sub-classes and not this class directly. Known sub-classes are: AssistantMessageItem, SystemMessageItem, UserMessageItem - :ivar id: - :vartype id: str - :ivar type: The type of the item; must be 'message' for message items. Required. MESSAGE. - :vartype type: str or ~azure.ai.voicelive.models.MESSAGE - :ivar role: The role of the message origionator. Required. Known values are: "system", "user", - and "assistant". - :vartype role: str or ~azure.ai.voicelive.models.MessageRole - :ivar content: The content parts of the message. Required. - :vartype content: list[~azure.ai.voicelive.models.MessageContentPart] - :ivar status: Processing status of the message item. Known values are: "completed" and - "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ItemParamStatus + :ivar role: Required. Known values are: "system", "user", and "assistant". + :vartype role: str or ~azure.ai.voicelive.models.RealtimeConversationItemMessageType """ __mapping__: dict[str, _Model] = {} - type: Literal[ItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item; must be 'message' for message items. Required. MESSAGE.""" role: str = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) - """The role of the message origionator. Required. Known values are: \"system\", \"user\", and - \"assistant\".""" - content: list["_models.MessageContentPart"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content parts of the message. Required.""" - status: Optional[Union[str, "_models.ItemParamStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Processing status of the message item. Known values are: \"completed\" and \"incomplete\".""" + """Required. Known values are: \"system\", \"user\", and \"assistant\".""" @overload def __init__( self, *, role: str, - content: list["_models.MessageContentPart"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - status: Optional[Union[str, "_models.ItemParamStatus"]] = None, ) -> None: ... @overload @@ -348,36 +323,94 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MESSAGE # type: ignore class AssistantMessageItem(MessageItem, discriminator="assistant"): - """An assistant message item within a conversation. + """Realtime assistant message item. - :ivar id: + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. :vartype id: str - :ivar type: The type of the item; must be 'message' for message items. Required. MESSAGE. - :vartype type: str or ~azure.ai.voicelive.models.MESSAGE - :ivar content: The content parts of the message. Required. - :vartype content: list[~azure.ai.voicelive.models.MessageContentPart] - :ivar status: Processing status of the message item. Known values are: "completed" and - "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ItemParamStatus - :ivar role: Required. ASSISTANT. + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: str + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``assistant``. Required. ASSISTANT. :vartype role: str or ~azure.ai.voicelive.models.ASSISTANT + :ivar content: The content of the message. Required. + :vartype content: + list[~azure.ai.voicelive.models.RealtimeConversationItemMessageAssistantContent] """ - __mapping__: dict[str, _Model] = {} - role: Literal[MessageRole.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. ASSISTANT.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.ASSISTANT] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``assistant``. Required. ASSISTANT.""" + content: list["_models.RealtimeConversationItemMessageAssistantContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" @overload def __init__( self, *, - content: list["_models.MessageContentPart"], + content: list["_models.RealtimeConversationItemMessageAssistantContent"], id: Optional[str] = None, # pylint: disable=redefined-builtin - status: Optional[Union[str, "_models.ItemParamStatus"]] = None, + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = 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.role = RealtimeConversationItemMessageType.ASSISTANT # type: ignore + self.type: Literal["message"] = "message" + + +class AudioConfig(_Model): + """GA Realtime nested audio configuration (``audio.input`` / ``audio.output``) for a VoiceLive + session. + + :ivar input: Input audio configuration. + :vartype input: ~azure.ai.voicelive.models.AudioInputConfig + :ivar output: Output audio configuration. + :vartype output: ~azure.ai.voicelive.models.AudioOutputConfig + """ + + input: Optional["_models.AudioInputConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Input audio configuration.""" + output: Optional["_models.AudioOutputConfig"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Output audio configuration.""" + + @overload + def __init__( + self, + *, + input: Optional["_models.AudioInputConfig"] = None, + output: Optional["_models.AudioOutputConfig"] = None, ) -> None: ... @overload @@ -389,7 +422,6 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = MessageRole.ASSISTANT # type: ignore class AudioEchoCancellation(_Model): @@ -410,7 +442,6 @@ class AudioEchoCancellation(_Model): * `1`: Mono input (default). * `2`: Interleaved stereo input where channel 0 is the microphone signal and channel 1 is the echo reference signal. - When set to 2, `reference_source` must be `client` and `input_audio_format` must be `pcm16`. :vartype channels: int @@ -434,7 +465,6 @@ class AudioEchoCancellation(_Model): * `1`: Mono input (default). * `2`: Interleaved stereo input where channel 0 is the microphone signal and channel 1 is the echo reference signal. - When set to 2, `reference_source` must be `client` and `input_audio_format` must be `pcm16`.""" @@ -458,15 +488,225 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["server_echo_cancellation"] = "server_echo_cancellation" +class AudioFormat(_Model): + """Base audio format object used by VoiceLive v1. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + PcmAudioFormat, PcmaAudioFormat, PcmuAudioFormat + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.voicelive.models.AudioFormatType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> 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 AudioFormats(_Model): + """AudioFormats. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AudioFormatsAudioPcm, AudioFormatsAudioPcma, AudioFormatsAudioPcmu + + :ivar type: Required. Known values are: "audio/pcm", "audio/pcmu", and "audio/pcma". + :vartype type: str or ~azure.ai.voicelive.models.AudioFormatsType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"audio/pcm\", \"audio/pcmu\", and \"audio/pcma\".""" + + @overload + def __init__( + self, + *, + type: str, + ) -> 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 AudioFormatsAudioPcm(AudioFormats, discriminator="audio/pcm"): + """AudioFormatsAudioPcm. + + :ivar type: Required. AUDIO_PCM. + :vartype type: str or ~azure.ai.voicelive.models.AUDIO_PCM + :ivar rate: Default value is 24000. + :vartype rate: int + """ + + type: Literal[AudioFormatsType.AUDIO_PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCM.""" + rate: Optional[Literal[24000]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is 24000.""" + + @overload + def __init__( + self, + *, + rate: Optional[Literal[24000]] = 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 = AudioFormatsType.AUDIO_PCM # type: ignore + + +class AudioFormatsAudioPcma(AudioFormats, discriminator="audio/pcma"): + """AudioFormatsAudioPcma. + + :ivar type: Required. AUDIO_PCMA. + :vartype type: str or ~azure.ai.voicelive.models.AUDIO_PCMA + """ + + type: Literal[AudioFormatsType.AUDIO_PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMA.""" + + @overload + def __init__( + self, + ) -> 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 = AudioFormatsType.AUDIO_PCMA # type: ignore + + +class AudioFormatsAudioPcmu(AudioFormats, discriminator="audio/pcmu"): + """AudioFormatsAudioPcmu. + + :ivar type: Required. AUDIO_PCMU. + :vartype type: str or ~azure.ai.voicelive.models.AUDIO_PCMU + """ + + type: Literal[AudioFormatsType.AUDIO_PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. AUDIO_PCMU.""" + + @overload + def __init__( + self, + ) -> 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 = AudioFormatsType.AUDIO_PCMU # type: ignore + + +class AudioInputConfig(_Model): + """Input audio configuration (OpenAI GA Realtime ``audio.input`` shape, with Azure extensions). + + :ivar format: Input audio format. Defaults to 24 kHz PCM. + :vartype format: ~azure.ai.voicelive.models.AudioFormat + :ivar transcription: Configuration for input audio transcription. + :vartype transcription: ~azure.ai.voicelive.models.AudioInputTranscriptionOptions + :ivar noise_reduction: Configuration for input audio noise reduction. + :vartype noise_reduction: ~azure.ai.voicelive.models.AudioNoiseReduction + :ivar turn_detection: Type of turn detection to use. + :vartype turn_detection: ~azure.ai.voicelive.models.TurnDetection + :ivar echo_cancellation: Configuration for echo cancellation during server-side audio + processing (Azure extension). + :vartype echo_cancellation: ~azure.ai.voicelive.models.AudioEchoCancellation + """ + + format: Optional["_models.AudioFormat"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Input audio format. Defaults to 24 kHz PCM.""" + transcription: Optional["_models.AudioInputTranscriptionOptions"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for input audio transcription.""" + noise_reduction: Optional["_models.AudioNoiseReduction"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for input audio noise reduction.""" + turn_detection: Optional["_models.TurnDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of turn detection to use.""" + echo_cancellation: Optional["_models.AudioEchoCancellation"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for echo cancellation during server-side audio processing (Azure extension).""" + + @overload + def __init__( + self, + *, + format: Optional["_models.AudioFormat"] = None, + transcription: Optional["_models.AudioInputTranscriptionOptions"] = None, + noise_reduction: Optional["_models.AudioNoiseReduction"] = None, + turn_detection: Optional["_models.TurnDetection"] = None, + echo_cancellation: Optional["_models.AudioEchoCancellation"] = 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 AudioInputTranscriptionOptions(_Model): """Configuration for input audio transcription. :ivar model: The transcription model to use. Supported values: 'whisper-1', - 'gpt-4o-transcribe', 'gpt-4o-mini-transcribe', 'mai-transcribe-1', 'azure-speech'. Required. Is - one of the following types: Literal["whisper-1"], Literal["gpt-4o-transcribe"], + 'gpt-4o-transcribe', 'gpt-4o-mini-transcribe', 'gpt-4o-transcribe-diarize', 'azure-speech', + 'azure-mrs', 'mai-transcribe-1', 'mai-transcribe-1.5', and 'mai-transcribe'. Required. Is one + of the following types: 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 - :vartype model: str or str or str or str or str or str or str + Literal["azure-speech"], Literal["azure-mrs"], Literal["mai-transcribe-1"], + Literal["mai-transcribe-1.5"], Literal["mai-transcribe"], str + :vartype model: str or str or str or str or str or str or str or str or str or str :ivar language: Optional language code in BCP-47 (e.g., 'en-US'), or ISO-639-1 (e.g., 'en'), or multi languages with auto detection, (e.g., 'en,zh'). :vartype language: str @@ -481,15 +721,20 @@ class AudioInputTranscriptionOptions(_Model): Literal["gpt-4o-transcribe"], Literal["gpt-4o-mini-transcribe"], Literal["gpt-4o-transcribe-diarize"], - Literal["mai-transcribe-1"], Literal["azure-speech"], + Literal["azure-mrs"], + Literal["mai-transcribe-1"], + Literal["mai-transcribe-1.5"], + Literal["mai-transcribe"], str, ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The transcription model to use. Supported values: 'whisper-1', 'gpt-4o-transcribe', - 'gpt-4o-mini-transcribe', 'mai-transcribe-1', 'azure-speech'. Required. Is one of the following - types: Literal[\"whisper-1\"], Literal[\"gpt-4o-transcribe\"], + 'gpt-4o-mini-transcribe', 'gpt-4o-transcribe-diarize', 'azure-speech', 'azure-mrs', + 'mai-transcribe-1', 'mai-transcribe-1.5', and 'mai-transcribe'. Required. Is one of the + following types: 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""" + Literal[\"azure-speech\"], Literal[\"azure-mrs\"], Literal[\"mai-transcribe-1\"], + Literal[\"mai-transcribe-1.5\"], Literal[\"mai-transcribe\"], str""" language: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Optional language code in BCP-47 (e.g., 'en-US'), or ISO-639-1 (e.g., 'en'), or multi languages with auto detection, (e.g., 'en,zh').""" @@ -507,8 +752,11 @@ def __init__( Literal["gpt-4o-transcribe"], Literal["gpt-4o-mini-transcribe"], Literal["gpt-4o-transcribe-diarize"], - Literal["mai-transcribe-1"], Literal["azure-speech"], + Literal["azure-mrs"], + Literal["mai-transcribe-1"], + Literal["mai-transcribe-1.5"], + Literal["mai-transcribe"], str, ], language: Optional[str] = None, @@ -528,24 +776,26 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class AudioNoiseReduction(_Model): - """Configuration for input audio noise reduction. + """Configuration for input audio noise reduction. Consumes the OpenAI GA Realtime noise-reduction + types (``near_field``, ``far_field``) and extends them with Azure's + ``azure_deep_noise_suppression``. :ivar type: The type of noise reduction model. Required. Is one of the following types: - Literal["azure_deep_noise_suppression"], Literal["near_field"], Literal["far_field"], str + Literal["near_field"], Literal["far_field"], Literal["azure_deep_noise_suppression"], str :vartype type: str or str or str or str """ - type: Union[Literal["azure_deep_noise_suppression"], Literal["near_field"], Literal["far_field"], str] = rest_field( + type: Union[Literal["near_field"], Literal["far_field"], Literal["azure_deep_noise_suppression"], str] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The type of noise reduction model. Required. Is one of the following types: - Literal[\"azure_deep_noise_suppression\"], Literal[\"near_field\"], Literal[\"far_field\"], str""" + Literal[\"near_field\"], Literal[\"far_field\"], Literal[\"azure_deep_noise_suppression\"], str""" @overload def __init__( self, *, - type: Union[Literal["azure_deep_noise_suppression"], Literal["near_field"], Literal["far_field"], str], + type: Union[Literal["near_field"], Literal["far_field"], Literal["azure_deep_noise_suppression"], str], ) -> None: ... @overload @@ -559,50 +809,158 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AvatarConfig(_Model): - """Configuration for avatar streaming and behavior during the session. +class AudioOutputConfig(_Model): + """Output audio configuration (OpenAI GA Realtime ``audio.output`` shape, with Azure extensions). - :ivar avatar_type: Type of avatar to use. Known values are: "video-avatar" and "photo-avatar". - :vartype avatar_type: str or ~azure.ai.voicelive.models.AvatarConfigTypes - :ivar ice_servers: Optional list of ICE servers to use for WebRTC connection establishment. - :vartype ice_servers: list[~azure.ai.voicelive.models.IceServer] - :ivar character: The character name or ID used for the avatar. Required. - :vartype character: str - :ivar style: Optional avatar style, such as emotional tone or speaking style. + :ivar format: Output audio format. Defaults to 24 kHz PCM. + :vartype format: ~azure.ai.voicelive.models.AudioFormat + :ivar voice: Voice name. + :vartype voice: str + :ivar voice_type: Voice implementation selected for synthesis. Known values are: "openai", + "azure-standard", "azure-custom", "azure-personal", "avatar-voice-sync", and + "azure-realtime-native". + :vartype voice_type: str or ~azure.ai.voicelive.models.VoiceType + :ivar speed: Numeric voice speed. + :vartype speed: float + :ivar voice_temperature: Voice variation temperature. + :vartype voice_temperature: float + :ivar custom_lexicon_url: URL of a custom pronunciation lexicon. + :vartype custom_lexicon_url: str + :ivar custom_text_normalization_url: URL of a custom text normalization configuration. + :vartype custom_text_normalization_url: str + :ivar prefer_locales: Preferred locales for multilingual synthesis. + :vartype prefer_locales: list[str] + :ivar locale: Enforced output locale. + :vartype locale: str + :ivar style: Voice speaking style. :vartype style: str - :ivar model: Base model to use for the avatar. Required for photo avatar. "vasa-1" - :vartype model: str or ~azure.ai.voicelive.models.PhotoAvatarBaseModes - :ivar customized: Indicates whether the avatar is customized or not. Required. - :vartype customized: bool - :ivar video: Optional video configuration including resolution, bitrate, and codec. - :vartype video: ~azure.ai.voicelive.models.VideoParams - :ivar scene: Configuration for the avatar's zoom level, position, rotation and movement - amplitude in the video frame. - :vartype scene: ~azure.ai.voicelive.models.Scene - :ivar output_protocol: Output protocol for avatar streaming. Default is 'webrtc'. Known values - are: "webrtc" and "websocket". - :vartype output_protocol: str or ~azure.ai.voicelive.models.AvatarOutputProtocol - :ivar output_audit_audio: When enabled, forwards audit audio via WebSocket for review/debugging - purposes, even when avatar output is delivered via WebRTC. - :vartype output_audit_audio: bool + :ivar pitch: Voice pitch adjustment. + :vartype pitch: str + :ivar volume: Voice volume adjustment. + :vartype volume: str + :ivar custom_voice_endpoint_id: Azure custom voice endpoint identifier. + :vartype custom_voice_endpoint_id: str + :ivar personal_voice_model: Azure personal/avatar voice model. + :vartype personal_voice_model: str + :ivar output_audio_timestamp_types: Types of timestamps to include in audio response content. + :vartype output_audio_timestamp_types: list[str or + ~azure.ai.voicelive.models.AudioTimestampType] """ - avatar_type: Optional[Union[str, "_models.AvatarConfigTypes"]] = rest_field( - name="type", visibility=["read", "create", "update", "delete", "query"] - ) - """Type of avatar to use. Known values are: \"video-avatar\" and \"photo-avatar\".""" - ice_servers: Optional[list["_models.IceServer"]] = rest_field( + format: Optional["_models.AudioFormat"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Output audio format. Defaults to 24 kHz PCM.""" + voice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Voice name.""" + voice_type: Optional[Union[str, "_models.VoiceType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Optional list of ICE servers to use for WebRTC connection establishment.""" - character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The character name or ID used for the avatar. Required.""" - style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional avatar style, such as emotional tone or speaking style.""" - model: Optional[Union[str, "_models.PhotoAvatarBaseModes"]] = rest_field( + """Voice implementation selected for synthesis. Known values are: \"openai\", \"azure-standard\", + \"azure-custom\", \"azure-personal\", \"avatar-voice-sync\", and \"azure-realtime-native\".""" + speed: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Numeric voice speed.""" + voice_temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Voice variation temperature.""" + custom_lexicon_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """URL of a custom pronunciation lexicon.""" + custom_text_normalization_url: Optional[str] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Base model to use for the avatar. Required for photo avatar. \"vasa-1\"""" + """URL of a custom text normalization configuration.""" + prefer_locales: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preferred locales for multilingual synthesis.""" + locale: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Enforced output locale.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Voice speaking style.""" + pitch: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Voice pitch adjustment.""" + volume: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Voice volume adjustment.""" + custom_voice_endpoint_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Azure custom voice endpoint identifier.""" + personal_voice_model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Azure personal/avatar voice model.""" + output_audio_timestamp_types: Optional[list[Union[str, "_models.AudioTimestampType"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Types of timestamps to include in audio response content.""" + + @overload + def __init__( + self, + *, + format: Optional["_models.AudioFormat"] = None, + voice: Optional[str] = None, + voice_type: Optional[Union[str, "_models.VoiceType"]] = None, + speed: Optional[float] = None, + voice_temperature: Optional[float] = None, + custom_lexicon_url: Optional[str] = None, + custom_text_normalization_url: Optional[str] = None, + prefer_locales: Optional[list[str]] = None, + locale: Optional[str] = None, + style: Optional[str] = None, + pitch: Optional[str] = None, + volume: Optional[str] = None, + custom_voice_endpoint_id: Optional[str] = None, + personal_voice_model: Optional[str] = None, + output_audio_timestamp_types: Optional[list[Union[str, "_models.AudioTimestampType"]]] = 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 AvatarConfig(_Model): + """Configuration for avatar streaming and behavior during the session. + + :ivar avatar_type: Type of avatar to use. Known values are: "video-avatar" and "photo-avatar". + :vartype avatar_type: str or ~azure.ai.voicelive.models.AvatarConfigTypes + :ivar ice_servers: Optional list of ICE servers to use for WebRTC connection establishment. + :vartype ice_servers: list[~azure.ai.voicelive.models.IceServer] + :ivar character: The character name or ID used for the avatar. Required. + :vartype character: str + :ivar style: Optional avatar style, such as emotional tone or speaking style. + :vartype style: str + :ivar model: Base model to use for the avatar. Required for photo avatar. "vasa-1" + :vartype model: str or ~azure.ai.voicelive.models.PhotoAvatarBaseModes + :ivar customized: Indicates whether the avatar is customized or not. Required. + :vartype customized: bool + :ivar video: Optional video configuration including resolution, bitrate, and codec. + :vartype video: ~azure.ai.voicelive.models.VideoParams + :ivar scene: Configuration for the avatar's zoom level, position, rotation and movement + amplitude in the video frame. + :vartype scene: ~azure.ai.voicelive.models.Scene + :ivar output_protocol: Output protocol for avatar streaming. Default is 'webrtc'. Known values + are: "webrtc" and "websocket". + :vartype output_protocol: str or ~azure.ai.voicelive.models.AvatarOutputProtocol + :ivar output_audit_audio: When enabled, forwards audit audio via WebSocket for review/debugging + purposes, even when avatar output is delivered via WebRTC. + :vartype output_audit_audio: bool + """ + + avatar_type: Optional[Union[str, "_models.AvatarConfigTypes"]] = rest_field( + name="type", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of avatar to use. Known values are: \"video-avatar\" and \"photo-avatar\".""" + ice_servers: Optional[list["_models.IceServer"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Optional list of ICE servers to use for WebRTC connection establishment.""" + character: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The character name or ID used for the avatar. Required.""" + style: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional avatar style, such as emotional tone or speaking style.""" + model: Optional[Union[str, "_models.PhotoAvatarBaseModes"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Base model to use for the avatar. Required for photo avatar. \"vasa-1\"""" customized: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Indicates whether the avatar is customized or not. Required.""" video: Optional["_models.VideoParams"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1138,21 +1496,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.type: Literal["azure-realtime-native"] = "azure-realtime-native" +class AzureResponseItem(_Model): + """Base for any response item; discriminated by ``type``. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ResponseFileSearchCallItem, ResponseWebSearchCallItem + + :ivar type: Required. Known values are: "web_search_call" and "file_search_call". + :vartype type: str or ~azure.ai.voicelive.models.ItemType + :ivar id: + :vartype id: str + :ivar object: Default value is "realtime.item". + :vartype object: str + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"web_search_call\" and \"file_search_call\".""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"realtime.item\".""" + + @overload + def __init__( + self, + *, + type: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = 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 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 + AzureSemanticDetection, AzureSemanticDetectionEn, AzureSemanticDetectionMultilingual, + SmartEndOfTurnDetection :ivar model: Required. Is one of the following types: Literal["semantic_detection_v1"], - Literal["semantic_detection_v1_en"], Literal["semantic_detection_v1_multilingual"], str - :vartype model: str or str or str or str + 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 """ __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\"], str""" + Literal[\"semantic_detection_v1_en\"], Literal[\"semantic_detection_v1_multilingual\"], + Literal[\"smart_end_of_turn_detection\"], str""" @overload def __init__( @@ -1302,20 +1704,19 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class TurnDetection(_Model): - """Top-level union for turn detection configuration. + """Realtime Turn Detection. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureSemanticVad, AzureSemanticVadEn, AzureSemanticVadMultilingual, ServerVad + AzureSemanticVad, AzureSemanticVadEn, AzureSemanticVadMultilingual, TurnDetectionSemanticVad, + RealtimeTurnDetectionServerVad - :ivar type: Required. Known values are: "server_vad", "azure_semantic_vad", - "azure_semantic_vad_en", and "azure_semantic_vad_multilingual". + :ivar type: Required. Known values are: "server_vad" and "semantic_vad". :vartype type: str or ~azure.ai.voicelive.models.TurnDetectionType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"server_vad\", \"azure_semantic_vad\", \"azure_semantic_vad_en\", - and \"azure_semantic_vad_multilingual\".""" + """Required. Known values are: \"server_vad\" and \"semantic_vad\".""" @overload def __init__( @@ -1338,8 +1739,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class AzureSemanticVad(TurnDetection, discriminator="azure_semantic_vad"): """Server Speech Detection (Azure semantic VAD, default variant). - :ivar type: Required. AZURE_SEMANTIC_VAD. - :vartype type: str or ~azure.ai.voicelive.models.AZURE_SEMANTIC_VAD + :ivar type: Required. Default value is "azure_semantic_vad". + :vartype type: str :ivar threshold: Activation threshold for VAD detection. Range: 0.0 to 1.0. :vartype threshold: float :ivar prefix_padding_ms: Amount of audio to include before speech is detected, in milliseconds. @@ -1365,8 +1766,8 @@ class AzureSemanticVad(TurnDetection, discriminator="azure_semantic_vad"): :vartype interrupt_response: bool """ - type: Literal[TurnDetectionType.AZURE_SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AZURE_SEMANTIC_VAD.""" + type: Literal["azure_semantic_vad"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"azure_semantic_vad\".""" threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Activation threshold for VAD detection. Range: 0.0 to 1.0.""" prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1415,14 +1816,14 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TurnDetectionType.AZURE_SEMANTIC_VAD # type: ignore + self.type = "azure_semantic_vad" # type: ignore class AzureSemanticVadEn(TurnDetection, discriminator="azure_semantic_vad_en"): """Server Speech Detection (Azure semantic VAD, English-only). - :ivar type: Required. AZURE_SEMANTIC_VAD_EN. - :vartype type: str or ~azure.ai.voicelive.models.AZURE_SEMANTIC_VAD_EN + :ivar type: Required. Default value is "azure_semantic_vad_en". + :vartype type: str :ivar threshold: Activation threshold for VAD detection. Range: 0.0 to 1.0. :vartype threshold: float :ivar prefix_padding_ms: Amount of audio to include before speech is detected, in milliseconds. @@ -1446,8 +1847,8 @@ class AzureSemanticVadEn(TurnDetection, discriminator="azure_semantic_vad_en"): :vartype interrupt_response: bool """ - type: Literal[TurnDetectionType.AZURE_SEMANTIC_VAD_EN] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AZURE_SEMANTIC_VAD_EN.""" + type: Literal["azure_semantic_vad_en"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"azure_semantic_vad_en\".""" threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Activation threshold for VAD detection. Range: 0.0 to 1.0.""" prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1493,14 +1894,14 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TurnDetectionType.AZURE_SEMANTIC_VAD_EN # type: ignore + self.type = "azure_semantic_vad_en" # type: ignore class AzureSemanticVadMultilingual(TurnDetection, discriminator="azure_semantic_vad_multilingual"): """Server Speech Detection (Azure semantic VAD). - :ivar type: Required. AZURE_SEMANTIC_VAD_MULTILINGUAL. - :vartype type: str or ~azure.ai.voicelive.models.AZURE_SEMANTIC_VAD_MULTILINGUAL + :ivar type: Required. Default value is "azure_semantic_vad_multilingual". + :vartype type: str :ivar threshold: Activation threshold for VAD detection. Range: 0.0 to 1.0. :vartype threshold: float :ivar prefix_padding_ms: Amount of audio to include before speech is detected, in milliseconds. @@ -1526,8 +1927,8 @@ class AzureSemanticVadMultilingual(TurnDetection, discriminator="azure_semantic_ :vartype interrupt_response: bool """ - type: Literal[TurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AZURE_SEMANTIC_VAD_MULTILINGUAL.""" + type: Literal["azure_semantic_vad_multilingual"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"azure_semantic_vad_multilingual\".""" threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Activation threshold for VAD detection. Range: 0.0 to 1.0.""" prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -1576,7 +1977,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TurnDetectionType.AZURE_SEMANTIC_VAD_MULTILINGUAL # type: ignore + self.type = "azure_semantic_vad_multilingual" # type: ignore class AzureStandardVoice(AzureVoice, discriminator="azure-standard"): @@ -1746,31 +2147,34 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CachedTokenDetails(_Model): - """Details of output token usage. +class ClientEvent(_Model): + """A realtime client event. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ClientEventBYOMCredentialUpdate, ClientEventInputAudioClear, ClientEventInputAudioTurnAppend, + ClientEventInputAudioTurnCancel, ClientEventInputAudioTurnEnd, ClientEventInputAudioTurnStart, + ClientEventInputTextDelta, ClientEventInputTextDone, ClientEventRtcCallSdpCreate, + ClientEventSessionAvatarConnect - :ivar text_tokens: Number of cached text tokens. Required. - :vartype text_tokens: int - :ivar audio_tokens: Number of cached audio tokens. Required. - :vartype audio_tokens: int - :ivar image_tokens: Number of cached image tokens. Required. - :vartype image_tokens: int + :ivar type: Required. Known values are: "conversation.item.create", "conversation.item.delete", + "conversation.item.retrieve", "conversation.item.truncate", "input_audio_buffer.append", + "input_audio_buffer.clear", "output_audio_buffer.clear", "input_audio_buffer.commit", + "response.cancel", "response.create", and "session.update". + :vartype type: str or ~azure.ai.voicelive.models.RealtimeClientEventType """ - text_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of cached text tokens. Required.""" - audio_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of cached audio tokens. Required.""" - image_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of cached image tokens. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"conversation.item.create\", \"conversation.item.delete\", + \"conversation.item.retrieve\", \"conversation.item.truncate\", \"input_audio_buffer.append\", + \"input_audio_buffer.clear\", \"output_audio_buffer.clear\", \"input_audio_buffer.commit\", + \"response.cancel\", \"response.create\", and \"session.update\".""" @overload def __init__( self, *, - text_tokens: int, - audio_tokens: int, - image_tokens: int, + type: str, ) -> None: ... @overload @@ -1784,48 +2188,31 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ClientEvent(_Model): - """A voicelive client event. +class ClientEventBYOMCredentialUpdate(ClientEvent, discriminator="byom_credential.update"): + """Updates authorization headers for an active bring-your-own-model connection. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ClientEventConversationItemCreate, ClientEventConversationItemDelete, - ClientEventConversationItemRetrieve, ClientEventConversationItemTruncate, - ClientEventInputAudioClear, ClientEventInputAudioTurnAppend, ClientEventInputAudioTurnCancel, - ClientEventInputAudioTurnEnd, ClientEventInputAudioTurnStart, - ClientEventInputAudioBufferAppend, ClientEventInputAudioBufferClear, - ClientEventInputAudioBufferCommit, ClientEventInputTextDelta, ClientEventInputTextDone, - ClientEventOutputAudioBufferClear, ClientEventResponseCancel, ClientEventResponseCreate, - 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", - "input_audio.turn.start", "input_audio.turn.append", "input_audio.turn.end", - "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", "input_text.delta", and "input_text.done". - :vartype type: str or ~azure.ai.voicelive.models.ClientEventType + :ivar type: The event type, must be ``byom_credential.update``. Required. Default value is + "byom_credential.update". + :vartype type: str :ivar event_id: :vartype event_id: str + :ivar authorization_headers: Authorization header names and values to apply to subsequent BYOM + requests. Required. + :vartype authorization_headers: dict[str, str] """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of event. Required. Known values are: \"session.update\", - \"input_audio_buffer.append\", \"input_audio_buffer.commit\", \"input_audio_buffer.clear\", - \"input_audio.turn.start\", \"input_audio.turn.append\", \"input_audio.turn.end\", - \"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\", \"input_text.delta\", and - \"input_text.done\".""" + type: Literal["byom_credential.update"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``byom_credential.update``. Required. Default value is + \"byom_credential.update\".""" event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + authorization_headers: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authorization header names and values to apply to subsequent BYOM requests. Required.""" @overload def __init__( self, *, - type: str, + authorization_headers: dict[str, str], event_id: Optional[str] = None, ) -> None: ... @@ -1838,49 +2225,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = "byom_credential.update" # type: ignore -class ClientEventConversationItemCreate(ClientEvent, discriminator="conversation.item.create"): - """Add a new Item to the Conversation's context, including messages, function calls, and function - call responses. This event can be used both to populate a "history" of the conversation and to - add new items mid-stream, but has the current limitation that it cannot populate assistant - audio messages. If successful, the server will respond with a ``conversation.item.created`` - event, otherwise an ``error`` event will be sent. +class ClientEventInputAudioClear(ClientEvent, discriminator="input_audio.clear"): + """Clears all input audio currently being streamed. - :ivar type: The event type, must be ``conversation.item.create``. Required. - CONVERSATION_ITEM_CREATE. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_CREATE - :ivar event_id: Optional client-generated ID used to identify this event. + :ivar type: The event type, must be 'input_audio.clear'. Required. Default value is + "input_audio.clear". + :vartype type: str + :ivar event_id: :vartype event_id: str - :ivar previous_item_id: The ID of the preceding item after which the new item will be inserted. - If not set, the new item will be appended to the end of the conversation. If set to ``root``, - the new item will be added to the beginning of the conversation. If set to an existing ID, it - allows an item to be inserted mid-conversation. If the ID cannot be found, an error will be - returned and the item will not be added. - :vartype previous_item_id: str - :ivar item: - :vartype item: ~azure.ai.voicelive.models.ConversationRequestItem - """ - - type: Literal[ClientEventType.CONVERSATION_ITEM_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.create``. Required. CONVERSATION_ITEM_CREATE.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the preceding item after which the new item will be inserted. If not set, the new - item will be appended to the end of the conversation. If set to ``root``, the new item will be - added to the beginning of the conversation. If set to an existing ID, it allows an item to be - inserted mid-conversation. If the ID cannot be found, an error will be returned and the item - will not be added.""" - item: Optional["_models.ConversationRequestItem"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) + """ + + type: Literal["input_audio.clear"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'input_audio.clear'. Required. Default value is \"input_audio.clear\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, event_id: Optional[str] = None, - previous_item_id: Optional[str] = None, - item: Optional["_models.ConversationRequestItem"] = None, ) -> None: ... @overload @@ -1892,33 +2258,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.CONVERSATION_ITEM_CREATE # type: ignore + self.type = "input_audio.clear" # type: ignore -class ClientEventConversationItemDelete(ClientEvent, discriminator="conversation.item.delete"): - """Send this event when you want to remove any item from the conversation history. The server will - respond with a ``conversation.item.deleted`` event, unless the item does not exist in the - conversation history, in which case the server will respond with an error. +class ClientEventInputAudioTurnAppend(ClientEvent, discriminator="input_audio.turn.append"): + """Appends audio data to an ongoing input turn. + :ivar type: The event type, must be 'input_audio.turn.append'. Required. Default value is + "input_audio.turn.append". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.delete``. Required. - CONVERSATION_ITEM_DELETE. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_DELETE - :ivar item_id: The ID of the item to delete. Required. - :vartype item_id: str + :ivar turn_id: The ID of the turn this audio is part of. Required. + :vartype turn_id: str + :ivar audio: Base64-encoded audio chunk. Required. + :vartype audio: str """ - type: Literal[ClientEventType.CONVERSATION_ITEM_DELETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.delete``. Required. CONVERSATION_ITEM_DELETE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to delete. Required.""" + type: Literal["input_audio.turn.append"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'input_audio.turn.append'. Required. Default value is + \"input_audio.turn.append\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the turn this audio is part of. Required.""" + audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Base64-encoded audio chunk. Required.""" @overload def __init__( self, *, - item_id: str, + turn_id: str, + audio: str, event_id: Optional[str] = None, ) -> None: ... @@ -1931,35 +2302,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.CONVERSATION_ITEM_DELETE # type: ignore + self.type = "input_audio.turn.append" # type: ignore -class ClientEventConversationItemRetrieve(ClientEvent, discriminator="conversation.item.retrieve"): - """Send this event when you want to retrieve the server's representation of a specific item in the - conversation history. This is useful, for example, to inspect user audio after noise - cancellation and VAD. The server will respond with a ``conversation.item.retrieved`` event, - unless the item does not exist in the conversation history, in which case the server will - respond with an error. +class ClientEventInputAudioTurnCancel(ClientEvent, discriminator="input_audio.turn.cancel"): + """Cancels an in-progress input audio turn. + :ivar type: The event type, must be 'input_audio.turn.cancel'. Required. Default value is + "input_audio.turn.cancel". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.retrieve``. Required. - CONVERSATION_ITEM_RETRIEVE. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_RETRIEVE - :ivar item_id: The ID of the item to retrieve. Required. - :vartype item_id: str + :ivar turn_id: The ID of the turn to cancel. Required. + :vartype turn_id: str """ - type: Literal[ClientEventType.CONVERSATION_ITEM_RETRIEVE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.retrieve``. Required. CONVERSATION_ITEM_RETRIEVE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to retrieve. Required.""" + type: Literal["input_audio.turn.cancel"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'input_audio.turn.cancel'. Required. Default value is + \"input_audio.turn.cancel\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the turn to cancel. Required.""" @overload def __init__( self, *, - item_id: str, + turn_id: str, event_id: Optional[str] = None, ) -> None: ... @@ -1972,52 +2341,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.CONVERSATION_ITEM_RETRIEVE # type: ignore + self.type = "input_audio.turn.cancel" # type: ignore -class ClientEventConversationItemTruncate(ClientEvent, discriminator="conversation.item.truncate"): - """Send this event to truncate a previous assistant message’s audio. The server will produce audio - faster than voicelive, so this event is useful when the user interrupts to truncate audio that - has already been sent to the client but not yet played. This will synchronize the server's - understanding of the audio with the client's playback. Truncating audio will delete the - server-side text transcript to ensure there is not text in the context that hasn't been heard - by the user. If successful, the server will respond with a ``conversation.item.truncated`` - event. +class ClientEventInputAudioTurnEnd(ClientEvent, discriminator="input_audio.turn.end"): + """Marks the end of an audio input turn. + :ivar type: The event type, must be 'input_audio.turn.end'. Required. Default value is + "input_audio.turn.end". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.truncate``. Required. - CONVERSATION_ITEM_TRUNCATE. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_TRUNCATE - :ivar item_id: The ID of the assistant message item to truncate. Only assistant message items - can be truncated. Required. - :vartype item_id: str - :ivar content_index: The index of the content part to truncate. Set this to 0. Required. - :vartype content_index: int - :ivar audio_end_ms: Inclusive duration up to which audio is truncated, in milliseconds. If the - audio_end_ms is greater than the actual audio duration, the server will respond with an error. - Required. - :vartype audio_end_ms: int + :ivar turn_id: The ID of the audio turn being ended. Required. + :vartype turn_id: str """ - type: Literal[ClientEventType.CONVERSATION_ITEM_TRUNCATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.truncate``. Required. CONVERSATION_ITEM_TRUNCATE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the assistant message item to truncate. Only assistant message items can be - truncated. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part to truncate. Set this to 0. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Inclusive duration up to which audio is truncated, in milliseconds. If the audio_end_ms is - greater than the actual audio duration, the server will respond with an error. Required.""" + type: Literal["input_audio.turn.end"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'input_audio.turn.end'. Required. Default value is + \"input_audio.turn.end\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the audio turn being ended. Required.""" @overload def __init__( self, *, - item_id: str, - content_index: int, - audio_end_ms: int, + turn_id: str, event_id: Optional[str] = None, ) -> None: ... @@ -2030,42 +2380,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.CONVERSATION_ITEM_TRUNCATE # type: ignore + self.type = "input_audio.turn.end" # type: ignore -class ClientEventInputAudioBufferAppend(ClientEvent, discriminator="input_audio_buffer.append"): - """Send this event to append audio bytes to the input audio buffer. The audio - buffer is temporary storage you can write to and later commit. In Server VAD - mode, the audio buffer is used to detect speech and the server will decide - when to commit. When Server VAD is disabled, you must commit the audio buffer - manually. - - The client may choose how much audio to place in each event up to a maximum - of 15 MiB, for example streaming smaller chunks from the client may allow the - VAD to be more responsive. Unlike made other client events, the server will - not send a confirmation response to this event. +class ClientEventInputAudioTurnStart(ClientEvent, discriminator="input_audio.turn.start"): + """Indicates the start of a new audio input turn. + :ivar type: The event type, must be 'input_audio.turn.start'. Required. Default value is + "input_audio.turn.start". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.append``. Required. - INPUT_AUDIO_BUFFER_APPEND. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_APPEND - :ivar audio: Base64-encoded audio. This must be in the format specified by the - ``input_audio_format`` field in the session configuration. Required. - :vartype audio: str + :ivar turn_id: Unique identifier for the input audio turn. Required. + :vartype turn_id: str """ - type: Literal[ClientEventType.INPUT_AUDIO_BUFFER_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.append``. Required. INPUT_AUDIO_BUFFER_APPEND.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio. This must be in the format specified by the ``input_audio_format`` field - in the session configuration. Required.""" + type: Literal["input_audio.turn.start"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'input_audio.turn.start'. Required. Default value is + \"input_audio.turn.start\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique identifier for the input audio turn. Required.""" @overload def __init__( self, *, - audio: str, + turn_id: str, event_id: Optional[str] = None, ) -> None: ... @@ -2078,28 +2419,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_BUFFER_APPEND # type: ignore + self.type = "input_audio.turn.start" # type: ignore -class ClientEventInputAudioBufferClear(ClientEvent, discriminator="input_audio_buffer.clear"): - """Send this event to clear the audio bytes in the buffer. The server will respond with an - ``input_audio_buffer.cleared`` event. +class ClientEventInputTextDelta(ClientEvent, discriminator="input_text.delta"): + """Streams a delta of input text content into the specified item. + :ivar type: The event type, must be ``input_text.delta``. Required. Default value is + "input_text.delta". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.clear``. Required. - INPUT_AUDIO_BUFFER_CLEAR. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_CLEAR + :ivar id: The ID of the item the text delta is being appended to. Required. + :vartype id: str + :ivar delta: The text delta to append. Required. + :vartype delta: str + :ivar content_index: The index of the content part within the item the delta applies to. + :vartype content_index: int """ - type: Literal[ClientEventType.INPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.clear``. Required. INPUT_AUDIO_BUFFER_CLEAR.""" + type: Literal["input_text.delta"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_text.delta``. Required. Default value is \"input_text.delta\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item the text delta is being appended to. Required.""" + delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text delta to append. Required.""" + content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part within the item the delta applies to.""" @overload def __init__( self, *, + id: str, # pylint: disable=redefined-builtin + delta: str, event_id: Optional[str] = None, + content_index: Optional[int] = None, ) -> None: ... @overload @@ -2111,32 +2467,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_BUFFER_CLEAR # type: ignore + self.type = "input_text.delta" # type: ignore -class ClientEventInputAudioBufferCommit(ClientEvent, discriminator="input_audio_buffer.commit"): - """Send this event to commit the user input audio buffer, which will create a new user message - item in the conversation. This event will produce an error if the input audio buffer is empty. - When in Server VAD mode, the client does not need to send this event, the server will commit - the audio buffer automatically. Committing the input audio buffer will trigger input audio - transcription (if enabled in session configuration), but it will not create a response from the - model. The server will respond with an ``input_audio_buffer.committed`` event. +class ClientEventInputTextDone(ClientEvent, discriminator="input_text.done"): + """Signals that the streamed input text content for the specified item is complete. + :ivar type: The event type, must be ``input_text.done``. Required. Default value is + "input_text.done". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.commit``. Required. - INPUT_AUDIO_BUFFER_COMMIT. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_COMMIT + :ivar id: The ID of the item whose text content has finished streaming. Required. + :vartype id: str + :ivar content_index: The index of the content part within the item. + :vartype content_index: int """ - type: Literal[ClientEventType.INPUT_AUDIO_BUFFER_COMMIT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.commit``. Required. INPUT_AUDIO_BUFFER_COMMIT.""" + type: Literal["input_text.done"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``input_text.done``. Required. Default value is \"input_text.done\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item whose text content has finished streaming. Required.""" + content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the content part within the item.""" @overload def __init__( self, *, + id: str, # pylint: disable=redefined-builtin event_id: Optional[str] = None, + content_index: Optional[int] = None, ) -> None: ... @overload @@ -2148,26 +2510,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_BUFFER_COMMIT # type: ignore + self.type = "input_text.done" # type: ignore -class ClientEventInputAudioClear(ClientEvent, discriminator="input_audio.clear"): - """Clears all input audio currently being streamed. +class ClientEventRtcCallSdpCreate(ClientEvent, discriminator="rtc.call.sdp.create"): + """Sent by the client to initiate a WebRTC session with an SDP offer. + :ivar type: The event type, must be ``rtc.call.sdp.create``. Required. Default value is + "rtc.call.sdp.create". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be 'input_audio.clear'. Required. INPUT_AUDIO_CLEAR. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_CLEAR + :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.INPUT_AUDIO_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'input_audio.clear'. Required. INPUT_AUDIO_CLEAR.""" + type: Literal["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. Default value is + \"rtc.call.sdp.create\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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 @@ -2179,36 +2555,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_CLEAR # type: ignore + self.type = "rtc.call.sdp.create" # type: ignore -class ClientEventInputAudioTurnAppend(ClientEvent, discriminator="input_audio.turn.append"): - """Appends audio data to an ongoing input turn. +class ClientEventSessionAvatarConnect(ClientEvent, discriminator="session.avatar.connect"): + """Sent when the client connects and provides its SDP (Session Description Protocol) + + for avatar-related media negotiation. + :ivar type: The event type, must be 'session.avatar.connect'. Required. Default value is + "session.avatar.connect". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be 'input_audio.turn.append'. Required. - INPUT_AUDIO_TURN_APPEND. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_TURN_APPEND - :ivar turn_id: The ID of the turn this audio is part of. Required. - :vartype turn_id: str - :ivar audio: Base64-encoded audio chunk. Required. - :vartype audio: str + :ivar client_sdp: The client's SDP offer. Required. + :vartype client_sdp: str """ - type: Literal[ClientEventType.INPUT_AUDIO_TURN_APPEND] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'input_audio.turn.append'. Required. INPUT_AUDIO_TURN_APPEND.""" - turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the turn this audio is part of. Required.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio chunk. Required.""" + type: Literal["session.avatar.connect"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'session.avatar.connect'. Required. Default value is + \"session.avatar.connect\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + client_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The client's SDP offer. Required.""" @overload def __init__( self, *, - turn_id: str, - audio: str, + client_sdp: str, event_id: Optional[str] = None, ) -> None: ... @@ -2221,32 +2596,29 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_TURN_APPEND # type: ignore + self.type = "session.avatar.connect" # type: ignore -class ClientEventInputAudioTurnCancel(ClientEvent, discriminator="input_audio.turn.cancel"): - """Cancels an in-progress input audio turn. +class ConversationItemBase(_Model): + """The item to add to the conversation.""" - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be 'input_audio.turn.cancel'. Required. - INPUT_AUDIO_TURN_CANCEL. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_TURN_CANCEL - :ivar turn_id: The ID of the turn to cancel. Required. - :vartype turn_id: str + +class ErrorResponse(_Model): + """Standard error response envelope. + + :ivar error: Error object returned in case of API failure (OpenAI GA Realtime error object). + Required. + :vartype error: ~azure.ai.voicelive.models.ServerEventErrorDetails """ - type: Literal[ClientEventType.INPUT_AUDIO_TURN_CANCEL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'input_audio.turn.cancel'. Required. INPUT_AUDIO_TURN_CANCEL.""" - turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the turn to cancel. Required.""" + error: "_models.ServerEventErrorDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error object returned in case of API failure (OpenAI GA Realtime error object). Required.""" @overload def __init__( self, *, - turn_id: str, - event_id: Optional[str] = None, + error: "_models.ServerEventErrorDetails", ) -> None: ... @overload @@ -2258,31 +2630,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_TURN_CANCEL # type: ignore -class ClientEventInputAudioTurnEnd(ClientEvent, discriminator="input_audio.turn.end"): - """Marks the end of an audio input turn. +class FileSearchResult(_Model): + """A file search result entry. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be 'input_audio.turn.end'. Required. INPUT_AUDIO_TURN_END. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_TURN_END - :ivar turn_id: The ID of the audio turn being ended. Required. - :vartype turn_id: str + :ivar attributes: Key-value pairs for filtering file search results. + :vartype attributes: dict[str, str] + :ivar file_id: The unique ID of the file. + :vartype file_id: str + :ivar filename: The name of the file. + :vartype filename: str + :ivar score: The relevance score of the file search result. + :vartype score: float + :ivar text: The text content of the file that matched the query. + :vartype text: str """ - type: Literal[ClientEventType.INPUT_AUDIO_TURN_END] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'input_audio.turn.end'. Required. INPUT_AUDIO_TURN_END.""" - turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the audio turn being ended. Required.""" + attributes: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Key-value pairs for filtering file search results.""" + file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the file.""" + filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the file.""" + score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The relevance score of the file search result.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The text content of the file that matched the query.""" @overload def __init__( self, *, - turn_id: str, - event_id: Optional[str] = None, + attributes: Optional[dict[str, str]] = None, + file_id: Optional[str] = None, + filename: Optional[str] = None, + score: Optional[float] = None, + text: Optional[str] = None, ) -> None: ... @overload @@ -2294,31 +2678,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_TURN_END # type: ignore -class ClientEventInputAudioTurnStart(ClientEvent, discriminator="input_audio.turn.start"): - """Indicates the start of a new audio input turn. +class RealtimeConversationItem(_Model): + """A single item within a Realtime conversation. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be 'input_audio.turn.start'. Required. INPUT_AUDIO_TURN_START. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_TURN_START - :ivar turn_id: Unique identifier for the input audio turn. Required. - :vartype turn_id: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + FunctionCallItem, FunctionCallOutputItem, RealtimeMCPApprovalRequest, + RealtimeMCPApprovalResponse, RealtimeMCPToolCall, RealtimeMCPListTools + + :ivar type: Required. Known values are: "function_call", "function_call_output", + "mcp_approval_response", "mcp_list_tools", "mcp_call", and "mcp_approval_request". + :vartype type: str or ~azure.ai.voicelive.models.RealtimeConversationItemType """ - type: Literal[ClientEventType.INPUT_AUDIO_TURN_START] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'input_audio.turn.start'. Required. INPUT_AUDIO_TURN_START.""" - turn_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Unique identifier for the input audio turn. Required.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"function_call\", \"function_call_output\", + \"mcp_approval_response\", \"mcp_list_tools\", \"mcp_call\", and \"mcp_approval_request\".""" @overload def __init__( self, *, - turn_id: str, - event_id: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -2330,43 +2713,61 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_AUDIO_TURN_START # type: ignore -class ClientEventInputTextDelta(ClientEvent, discriminator="input_text.delta"): - """Streams a delta of input text content into the specified item. +class FunctionCallItem(RealtimeConversationItem, discriminator="function_call"): + """Realtime function call item. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``input_text.delta``. Required. Streamed delta of input - text content being appended to an item. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_TEXT_DELTA - :ivar id: The ID of the item the text delta is being appended to. Required. + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. :vartype id: str - :ivar delta: The text delta to append. Required. - :vartype delta: str - :ivar content_index: The index of the content part within the item the delta applies to. - :vartype content_index: int + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``function_call``. Required. FUNCTION_CALL. + :vartype type: str or ~azure.ai.voicelive.models.FUNCTION_CALL + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar call_id: The ID of the function call. + :vartype call_id: str + :ivar name: The name of the function being called. Required. + :vartype name: str + :ivar arguments: The arguments of the function call. This is a JSON-encoded string representing + the arguments passed to the function, for example ``{"arg1": "value1", "arg2": 42}``. Required. + :vartype arguments: str """ - type: Literal[ClientEventType.INPUT_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_text.delta``. Required. Streamed delta of input text content - being appended to an item.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item the text delta is being appended to. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta to append. Required.""" - content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part within the item the delta applies to.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal[RealtimeConversationItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``function_call``. Required. FUNCTION_CALL.""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + call_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function being called. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The arguments of the function call. This is a JSON-encoded string representing the arguments + passed to the function, for example ``{\"arg1\": \"value1\", \"arg2\": 42}``. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - delta: str, - event_id: Optional[str] = None, - content_index: Optional[int] = None, + name: str, + arguments: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, + call_id: Optional[str] = None, ) -> None: ... @overload @@ -2378,38 +2779,58 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_TEXT_DELTA # type: ignore + self.type = RealtimeConversationItemType.FUNCTION_CALL # type: ignore -class ClientEventInputTextDone(ClientEvent, discriminator="input_text.done"): - """Signals that the streamed input text content for the specified item is complete. +class FunctionCallOutputItem(RealtimeConversationItem, discriminator="function_call_output"): + """Realtime function call output item. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``input_text.done``. Required. Signals that the streamed - input text content for an item is complete. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_TEXT_DONE - :ivar id: The ID of the item whose text content has finished streaming. Required. + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. :vartype id: str - :ivar content_index: The index of the content part within the item. - :vartype content_index: int + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``function_call_output``. Required. + FUNCTION_CALL_OUTPUT. + :vartype type: str or ~azure.ai.voicelive.models.FUNCTION_CALL_OUTPUT + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar call_id: The ID of the function call this output is for. Required. + :vartype call_id: str + :ivar output: The output of the function call, this is free text and can contain any + information or simply be empty. Required. + :vartype output: str """ - type: Literal[ClientEventType.INPUT_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_text.done``. Required. Signals that the streamed input text - content for an item is complete.""" - id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item whose text content has finished streaming. Required.""" - content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part within the item.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal[RealtimeConversationItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``function_call_output``. Required. FUNCTION_CALL_OUTPUT.""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the function call this output is for. Required.""" + output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The output of the function call, this is free text and can contain any information or simply be + empty. Required.""" @overload def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - event_id: Optional[str] = None, - content_index: Optional[int] = None, + call_id: str, + output: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -2421,28 +2842,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.INPUT_TEXT_DONE # type: ignore + self.type = RealtimeConversationItemType.FUNCTION_CALL_OUTPUT # type: ignore -class ClientEventOutputAudioBufferClear(ClientEvent, discriminator="output_audio_buffer.clear"): - """Client request to clear the avatar output buffer. +class FunctionTool(_Model): + """Function tool. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.clear``. Required. Client request to - clear the avatar output buffer. - :vartype type: str or ~azure.ai.voicelive.models.OUTPUT_AUDIO_BUFFER_CLEAR + :ivar type: The type of the tool, i.e. ``function``. Default value is "function". + :vartype type: str + :ivar name: The name of the function. + :vartype name: str + :ivar description: The description of the function, including guidance on when and how to call + it, and guidance about what to tell the user when calling (if anything). + :vartype description: str + :ivar parameters: Parameters of the function in JSON Schema. + :vartype parameters: ~azure.ai.voicelive.models.RealtimeFunctionToolParameters """ - type: Literal[ClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.clear``. Required. Client request to clear the - avatar output buffer.""" + type: Optional[Literal["function"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the tool, i.e. ``function``. Default value is \"function\".""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the function, including guidance on when and how to call it, and guidance + about what to tell the user when calling (if anything).""" + parameters: Optional["_models.RealtimeFunctionToolParameters"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters of the function in JSON Schema.""" @overload def __init__( self, *, - event_id: Optional[str] = None, + type: Optional[Literal["function"]] = None, + name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional["_models.RealtimeFunctionToolParameters"] = None, ) -> None: ... @overload @@ -2454,34 +2890,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.OUTPUT_AUDIO_BUFFER_CLEAR # type: ignore -class ClientEventResponseCancel(ClientEvent, discriminator="response.cancel"): - """Send this event to cancel an in-progress response. The server will respond with a - ``response.cancelled`` event or an error if there is no response to cancel. +class IceServer(_Model): + """ICE server configuration for WebRTC connection negotiation. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_CANCEL - :ivar response_id: A specific response ID to cancel - if not provided, will cancel an - in-progress response in the default conversation. - :vartype response_id: str + :ivar urls: List of ICE server URLs (e.g., TURN or STUN endpoints). Required. + :vartype urls: list[str] + :ivar username: Optional username used for authentication with the ICE server. + :vartype username: str + :ivar credential: Optional credential (e.g., password or token) used for authentication. + :vartype credential: str """ - type: Literal[ClientEventType.RESPONSE_CANCEL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.cancel``. Required. RESPONSE_CANCEL.""" - response_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A specific response ID to cancel - if not provided, will cancel an in-progress response in the - default conversation.""" + urls: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of ICE server URLs (e.g., TURN or STUN endpoints). Required.""" + username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional username used for authentication with the ICE server.""" + credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Optional credential (e.g., password or token) used for authentication.""" @overload def __init__( self, *, - event_id: Optional[str] = None, - response_id: Optional[str] = None, + urls: list[str], + username: Optional[str] = None, + credential: Optional[str] = None, ) -> None: ... @overload @@ -2493,46 +2928,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.RESPONSE_CANCEL # type: ignore -class ClientEventResponseCreate(ClientEvent, discriminator="response.create"): - """This event instructs the server to create a Response, which means triggering model inference. - When in Server VAD mode, the server will create Responses automatically. A Response will - include at least one Item, and may have two, in which case the second will be a function call. - These Items will be appended to the conversation history. The server will respond with a - ``response.created`` event, events for Items and content created, and finally a - ``response.done`` event to indicate the Response is complete. The ``response.create`` event - includes inference configuration like ``instructions``, and ``temperature``. These fields will - override the Session's configuration for this Response only. +class InterimResponseConfigBase(_Model): + """Base model for interim response configuration. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.create``. Required. RESPONSE_CREATE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_CREATE - :ivar response: - :vartype response: ~azure.ai.voicelive.models.ResponseCreateParams - :ivar additional_instructions: additional instructions (system prompt) appended to the default - instructions of the session. Only affects this response only. - :vartype additional_instructions: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + LlmInterimResponseConfig, StaticInterimResponseConfig + + :ivar type: The type of interim response configuration. Required. Known values are: + "static_interim_response" and "llm_interim_response". + :vartype type: str or ~azure.ai.voicelive.models.InterimResponseConfigType + :ivar triggers: List of triggers that can fire the interim response. Any trigger can activate + it (OR logic). Supported: 'latency', 'tool'. + :vartype triggers: list[str or ~azure.ai.voicelive.models.InterimResponseTrigger] + :ivar latency_threshold_ms: Latency threshold in milliseconds before triggering interim + response. Default is 2000ms. + :vartype latency_threshold_ms: int """ - type: Literal[ClientEventType.RESPONSE_CREATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.create``. Required. RESPONSE_CREATE.""" - response: Optional["_models.ResponseCreateParams"] = rest_field( + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """The type of interim response configuration. Required. Known values are: + \"static_interim_response\" and \"llm_interim_response\".""" + triggers: Optional[list[Union[str, "_models.InterimResponseTrigger"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - additional_instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """additional instructions (system prompt) appended to the default instructions of the session. - Only affects this response only.""" + """List of triggers that can fire the interim response. Any trigger can activate it (OR logic). + Supported: 'latency', 'tool'.""" + latency_threshold_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Latency threshold in milliseconds before triggering interim response. Default is 2000ms.""" @overload def __init__( self, *, - event_id: Optional[str] = None, - response: Optional["_models.ResponseCreateParams"] = None, - additional_instructions: Optional[str] = None, + type: str, + triggers: Optional[list[Union[str, "_models.InterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, ) -> None: ... @overload @@ -2544,33 +2977,49 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.RESPONSE_CREATE # type: ignore - -class ClientEventSessionAvatarConnect(ClientEvent, discriminator="session.avatar.connect"): - """Sent when the client connects and provides its SDP (Session Description Protocol) - for avatar-related media negotiation. +class LlmInterimResponseConfig(InterimResponseConfigBase, discriminator="llm_interim_response"): + """Configuration for LLM-based interim response generation. Uses LLM to generate context-aware + interim responses when any trigger condition is met. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be 'session.avatar.connect'. Required. SESSION_AVATAR_CONNECT. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_AVATAR_CONNECT - :ivar client_sdp: The client's SDP offer. Required. - :vartype client_sdp: str + :ivar triggers: List of triggers that can fire the interim response. Any trigger can activate + it (OR logic). Supported: 'latency', 'tool'. + :vartype triggers: list[str or ~azure.ai.voicelive.models.InterimResponseTrigger] + :ivar latency_threshold_ms: Latency threshold in milliseconds before triggering interim + response. Default is 2000ms. + :vartype latency_threshold_ms: int + :ivar type: Required. LLM-based interim response configuration type. + :vartype type: str or ~azure.ai.voicelive.models.LLM_INTERIM_RESPONSE + :ivar model: The model to use for LLM-based interim response generation. Default is + gpt-4.1-mini. + :vartype model: str + :ivar instructions: Custom instructions for generating interim responses. If not provided, a + default prompt is used. + :vartype instructions: str + :ivar max_completion_tokens: Maximum number of tokens to generate for the interim response. + :vartype max_completion_tokens: int """ - type: Literal[ClientEventType.SESSION_AVATAR_CONNECT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'session.avatar.connect'. Required. SESSION_AVATAR_CONNECT.""" - client_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The client's SDP offer. Required.""" + type: Literal[InterimResponseConfigType.LLM_INTERIM_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. LLM-based interim response configuration type.""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The model to use for LLM-based interim response generation. Default is gpt-4.1-mini.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Custom instructions for generating interim responses. If not provided, a default prompt is + used.""" + max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Maximum number of tokens to generate for the interim response.""" @overload def __init__( self, *, - client_sdp: str, - event_id: Optional[str] = None, + triggers: Optional[list[Union[str, "_models.InterimResponseTrigger"]]] = None, + latency_threshold_ms: Optional[int] = None, + model: Optional[str] = None, + instructions: Optional[str] = None, + max_completion_tokens: Optional[int] = None, ) -> None: ... @overload @@ -2582,36 +3031,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.SESSION_AVATAR_CONNECT # type: ignore - + self.type = InterimResponseConfigType.LLM_INTERIM_RESPONSE # type: ignore -class ClientEventSessionUpdate(ClientEvent, discriminator="session.update"): - """Send this event to update the session’s default configuration. The client may send this event - at any time to update any field, except for ``voice``. However, note that once a session has - been initialized with a particular ``model``, it can’t be changed to another model using - ``session.update``. When the server receives a ``session.update``, it will respond with a - ``session.updated`` event showing the full, effective configuration. Only the fields that are - present are updated. To clear a field like ``instructions``, pass an empty string. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``session.update``. Required. SESSION_UPDATE. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_UPDATE - :ivar session: Required. - :vartype session: ~azure.ai.voicelive.models.RequestSession - """ +class LogProbProperties(_Model): + """A single log probability entry for a token. - type: Literal[ClientEventType.SESSION_UPDATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.update``. Required. SESSION_UPDATE.""" - session: "_models.RequestSession" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + :ivar token: The token that was used to generate the log probability. Required. + :vartype token: str + :ivar logprob: The log probability of the token. Required. + :vartype logprob: float + :ivar bytes: The bytes that were used to generate the log probability. Required. + :vartype bytes: list[int] + """ + + token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The token that was used to generate the log probability. Required.""" + logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The log probability of the token. Required.""" + bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The bytes that were used to generate the log probability. Required.""" @overload def __init__( self, *, - session: "_models.RequestSession", - event_id: Optional[str] = None, + token: str, + logprob: float, + bytes: list[int], ) -> None: ... @overload @@ -2623,25 +3070,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ClientEventType.SESSION_UPDATE # type: ignore -class ContentPart(_Model): - """Base for any content part; discriminated by ``type``. +class MCPError(_Model): + """MCPError. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponseAudioContentPart, RequestAudioContentPart, RequestImageContentPart, - RequestTextContentPart, ResponseTextContentPart + MCPHTTPError, MCPProtocolError, MCPToolExecutionError - :ivar type: Required. Known values are: "input_text", "input_audio", "input_image", "text", and - "audio". - :vartype type: str or ~azure.ai.voicelive.models.ContentPartType + :ivar type: Required. Known values are: "protocol_error", "tool_execution_error", and + "http_error". + :vartype type: str or ~azure.ai.voicelive.models.McpErrorType """ __mapping__: dict[str, _Model] = {} type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"input_text\", \"input_audio\", \"input_image\", \"text\", and - \"audio\".""" + """Required. Known values are: \"protocol_error\", \"tool_execution_error\", and \"http_error\".""" @overload def __init__( @@ -2661,25 +3105,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ConversationItemBase(_Model): - """The item to add to the conversation.""" - - -class ErrorResponse(_Model): - """Standard error response envelope. +class MCPHTTPError(MCPError, discriminator="http_error"): + """Realtime MCP HTTP error. - :ivar error: Error object returned in case of API failure. Required. - :vartype error: ~azure.ai.voicelive.models.VoiceLiveErrorDetails + :ivar type: Required. HTTP_ERROR. + :vartype type: str or ~azure.ai.voicelive.models.HTTP_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str """ - error: "_models.VoiceLiveErrorDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error object returned in case of API failure. Required.""" + type: Literal[McpErrorType.HTTP_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. HTTP_ERROR.""" + code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - error: "_models.VoiceLiveErrorDetails", + code: int, + message: str, ) -> None: ... @overload @@ -2691,43 +3140,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = McpErrorType.HTTP_ERROR # type: ignore -class FileSearchResult(_Model): - """A file search result entry. +class MCPListToolsTool(_Model): + """MCP list tools tool. - :ivar attributes: Key-value pairs for filtering file search results. - :vartype attributes: dict[str, str] - :ivar file_id: The unique ID of the file. - :vartype file_id: str - :ivar filename: The name of the file. - :vartype filename: str - :ivar score: The relevance score of the file search result. - :vartype score: float - :ivar text: The text content of the file that matched the query. - :vartype text: str + :ivar name: The name of the tool. Required. + :vartype name: str + :ivar description: + :vartype description: str + :ivar input_schema: The JSON schema describing the tool's input. Required. + :vartype input_schema: ~azure.ai.voicelive.models.MCPListToolsToolInputSchema + :ivar annotations: + :vartype annotations: ~azure.ai.voicelive.models.MCPListToolsToolAnnotations """ - attributes: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Key-value pairs for filtering file search results.""" - file_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the file.""" - filename: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the file.""" - score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The relevance score of the file search result.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text content of the file that matched the query.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool. Required.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_schema: "_models.MCPListToolsToolInputSchema" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The JSON schema describing the tool's input. Required.""" + annotations: Optional["_models.MCPListToolsToolAnnotations"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - attributes: Optional[dict[str, str]] = None, - file_id: Optional[str] = None, - filename: Optional[str] = None, - score: Optional[float] = None, - text: Optional[str] = None, + name: str, + input_schema: "_models.MCPListToolsToolInputSchema", + description: Optional[str] = None, + annotations: Optional["_models.MCPListToolsToolAnnotations"] = None, ) -> None: ... @overload @@ -2741,45 +3188,38 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FunctionCallItem(ConversationRequestItem, discriminator="function_call"): - """A function call item within a conversation. +class MCPListToolsToolAnnotations(_Model): + """MCPListToolsToolAnnotations.""" - :ivar id: - :vartype id: str - :ivar type: Required. FUNCTION_CALL. - :vartype type: str or ~azure.ai.voicelive.models.FUNCTION_CALL - :ivar name: Required. - :vartype name: str - :ivar call_id: Required. - :vartype call_id: str - :ivar arguments: Required. - :vartype arguments: str - :ivar status: Known values are: "completed" and "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ItemParamStatus + +class MCPListToolsToolInputSchema(_Model): + """MCPListToolsToolInputSchema.""" + + +class MCPProtocolError(MCPError, discriminator="protocol_error"): + """Realtime MCP protocol error. + + :ivar type: Required. PROTOCOL_ERROR. + :vartype type: str or ~azure.ai.voicelive.models.PROTOCOL_ERROR + :ivar code: Required. + :vartype code: int + :ivar message: Required. + :vartype message: str """ - type: Literal[ItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FUNCTION_CALL.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[McpErrorType.PROTOCOL_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PROTOCOL_ERROR.""" + code: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - status: Optional[Union[str, "_models.ItemParamStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"completed\" and \"incomplete\".""" @overload def __init__( self, *, - name: str, - call_id: str, - arguments: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - status: Optional[Union[str, "_models.ItemParamStatus"]] = None, + code: int, + message: str, ) -> None: ... @overload @@ -2791,43 +3231,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.FUNCTION_CALL # type: ignore + self.type = McpErrorType.PROTOCOL_ERROR # type: ignore -class FunctionCallOutputItem(ConversationRequestItem, discriminator="function_call_output"): - """A function call output item within a conversation. +class MCPToolExecutionError(MCPError, discriminator="tool_execution_error"): + """Realtime MCP tool execution error. - :ivar id: - :vartype id: str - :ivar type: Required. FUNCTION_CALL_OUTPUT. - :vartype type: str or ~azure.ai.voicelive.models.FUNCTION_CALL_OUTPUT - :ivar call_id: Required. - :vartype call_id: str - :ivar output: Required. - :vartype output: str - :ivar status: Known values are: "completed" and "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ItemParamStatus + :ivar type: Required. TOOL_EXECUTION_ERROR. + :vartype type: str or ~azure.ai.voicelive.models.TOOL_EXECUTION_ERROR + :ivar message: Required. + :vartype message: str """ - type: Literal[ItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FUNCTION_CALL_OUTPUT.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[McpErrorType.TOOL_EXECUTION_ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. TOOL_EXECUTION_ERROR.""" + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Required.""" - status: Optional[Union[str, "_models.ItemParamStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"completed\" and \"incomplete\".""" @overload def __init__( self, *, - call_id: str, - output: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - status: Optional[Union[str, "_models.ItemParamStatus"]] = None, + message: str, ) -> None: ... @overload @@ -2839,28 +3264,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.FUNCTION_CALL_OUTPUT # type: ignore + self.type = McpErrorType.TOOL_EXECUTION_ERROR # type: ignore -class Tool(_Model): - """The base representation of a voicelive tool definition. +class Metadata(_Model): + """Set of 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, and querying for objects via + API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are + strings with a maximum length of 512 characters. + + """ - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - FunctionTool, MCPServer - :ivar type: Required. Known values are: "function" and "mcp". - :vartype type: str or ~azure.ai.voicelive.models.ToolType +class OpenAIVoice(_Model): + """OpenAI voice configuration with explicit type field. + + This provides a unified interface for OpenAI voices, complementing the + existing string-based OAIVoice for backward compatibility. + + :ivar type: The type of the voice. Required. Default value is "openai". + :vartype type: str + :ivar name: The name of the OpenAI voice. Required. Known values are: "alloy", "ash", "ballad", + "coral", "echo", "sage", "shimmer", "verse", "marin", and "cedar". + :vartype name: str or ~azure.ai.voicelive.models.OpenAIVoiceName """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function\" and \"mcp\".""" + type: Literal["openai"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the voice. Required. Default value is \"openai\".""" + name: Union[str, "_models.OpenAIVoiceName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the OpenAI voice. Required. Known values are: \"alloy\", \"ash\", \"ballad\", + \"coral\", \"echo\", \"sage\", \"shimmer\", \"verse\", \"marin\", and \"cedar\".""" @overload def __init__( self, *, - type: str, + name: Union[str, "_models.OpenAIVoiceName"], ) -> None: ... @overload @@ -2872,35 +3311,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["openai"] = "openai" -class FunctionTool(Tool, discriminator="function"): - """The definition of a function tool as used by the voicelive endpoint. +class PcmaAudioFormat(AudioFormat, discriminator="audio/pcma"): + """G.711 A-law audio at 8 kHz. - :ivar type: Required. FUNCTION. - :vartype type: str or ~azure.ai.voicelive.models.FUNCTION - :ivar name: Required. - :vartype name: str - :ivar description: - :vartype description: str - :ivar parameters: - :vartype parameters: any + :ivar type: Required. PCMA. + :vartype type: str or ~azure.ai.voicelive.models.PCMA """ - type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FUNCTION.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - parameters: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Literal[AudioFormatType.PCMA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PCMA.""" @overload def __init__( self, - *, - name: str, - description: Optional[str] = None, - parameters: Optional[Any] = None, ) -> None: ... @overload @@ -2912,34 +3338,28 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore + self.type = AudioFormatType.PCMA # type: ignore -class IceServer(_Model): - """ICE server configuration for WebRTC connection negotiation. +class PcmAudioFormat(AudioFormat, discriminator="audio/pcm"): + """PCM audio with an explicit sample rate. - :ivar urls: List of ICE server URLs (e.g., TURN or STUN endpoints). Required. - :vartype urls: list[str] - :ivar username: Optional username used for authentication with the ICE server. - :vartype username: str - :ivar credential: Optional credential (e.g., password or token) used for authentication. - :vartype credential: str + :ivar type: Required. PCM. + :vartype type: str or ~azure.ai.voicelive.models.PCM + :ivar rate: Is one of the following types: Literal[8000], Literal[16000], Literal[24000] + :vartype rate: int or int or int """ - urls: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """List of ICE server URLs (e.g., TURN or STUN endpoints). Required.""" - username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional username used for authentication with the ICE server.""" - credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional credential (e.g., password or token) used for authentication.""" + type: Literal[AudioFormatType.PCM] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PCM.""" + rate: Optional[Literal[8000, 16000, 24000]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Is one of the following types: Literal[8000], Literal[16000], Literal[24000]""" @overload def __init__( self, *, - urls: list[str], - username: Optional[str] = None, - credential: Optional[str] = None, + rate: Optional[Literal[8000, 16000, 24000]] = None, ) -> None: ... @overload @@ -2951,29 +3371,22 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AudioFormatType.PCM # type: ignore -class MessageContentPart(_Model): - """Base for any message content part; discriminated by ``type``. +class PcmuAudioFormat(AudioFormat, discriminator="audio/pcmu"): + """G.711 μ-law audio at 8 kHz. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - InputAudioContentPart, InputTextContentPart, OutputTextContentPart - - :ivar type: The type of the content part. Required. Known values are: "input_text", - "input_audio", "input_image", "text", and "audio". - :vartype type: str or ~azure.ai.voicelive.models.ContentPartType + :ivar type: Required. PCMU. + :vartype type: str or ~azure.ai.voicelive.models.PCMU """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of the content part. Required. Known values are: \"input_text\", \"input_audio\", - \"input_image\", \"text\", and \"audio\".""" + type: Literal[AudioFormatType.PCMU] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. PCMU.""" @overload def __init__( self, - *, - type: str, ) -> None: ... @overload @@ -2985,30 +3398,37 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = AudioFormatType.PCMU # type: ignore -class InputAudioContentPart(MessageContentPart, discriminator="input_audio"): - """Input audio content part. +class RealtimeConversationItemMessageAssistantContent(_Model): # pylint: disable=name-too-long + """RealtimeConversationItemMessageAssistantContent. - :ivar type: Required. INPUT_AUDIO. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO - :ivar audio: Required. + :ivar type: Is either a Literal["output_text"] type or a Literal["output_audio"] type. + :vartype type: str or str + :ivar text: + :vartype text: str + :ivar audio: :vartype audio: str :ivar transcript: :vartype transcript: str """ - type: Literal[ContentPartType.INPUT_AUDIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. INPUT_AUDIO.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Optional[Literal["output_text", "output_audio"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Literal[\"output_text\"] type or a Literal[\"output_audio\"] type.""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - audio: str, + type: Optional[Literal["output_text", "output_audio"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, transcript: Optional[str] = None, ) -> None: ... @@ -3021,28 +3441,27 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContentPartType.INPUT_AUDIO # type: ignore -class InputTextContentPart(MessageContentPart, discriminator="input_text"): - """Input text content part. +class RealtimeConversationItemMessageSystemContent(_Model): # pylint: disable=name-too-long + """RealtimeConversationItemMessageSystemContent. - :ivar type: Required. INPUT_TEXT. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_TEXT - :ivar text: Required. + :ivar type: Default value is "input_text". + :vartype type: str + :ivar text: :vartype text: str """ - type: Literal[ContentPartType.INPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. INPUT_TEXT.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Optional[Literal["input_text"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default value is \"input_text\".""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - text: str, + type: Optional[Literal["input_text"]] = None, + text: Optional[str] = None, ) -> None: ... @overload @@ -3054,46 +3473,50 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContentPartType.INPUT_TEXT # type: ignore -class InputTokenDetails(_Model): - """Details of input token usage. +class RealtimeConversationItemMessageUserContent(_Model): # pylint: disable=name-too-long + """RealtimeConversationItemMessageUserContent. - :ivar cached_tokens: Number of cached tokens used in the input. Required. - :vartype cached_tokens: int - :ivar text_tokens: Number of text tokens used in the input. Required. - :vartype text_tokens: int - :ivar audio_tokens: Number of audio tokens used in the input. Required. - :vartype audio_tokens: int - :ivar image_tokens: Number of image tokens used in the input. Required. - :vartype image_tokens: int - :ivar cached_tokens_details: Details of cached token usage. Required. - :vartype cached_tokens_details: ~azure.ai.voicelive.models.CachedTokenDetails - """ - - cached_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of cached tokens used in the input. Required.""" - text_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of text tokens used in the input. Required.""" - audio_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of audio tokens used in the input. Required.""" - image_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of image tokens used in the input. Required.""" - cached_tokens_details: "_models.CachedTokenDetails" = rest_field( + :ivar type: Is one of the following types: Literal["input_text"], Literal["input_audio"], + Literal["input_image"] + :vartype type: str or str or str + :ivar text: + :vartype text: str + :ivar audio: + :vartype audio: str + :ivar image_url: + :vartype image_url: str + :ivar detail: Is one of the following types: Literal["auto"], Literal["low"], Literal["high"] + :vartype detail: str or str or str + :ivar transcript: + :vartype transcript: str + """ + + type: Optional[Literal["input_text", "input_audio", "input_image"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"input_text\"], Literal[\"input_audio\"], + Literal[\"input_image\"]""" + text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + detail: Optional[Literal["auto", "low", "high"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Details of cached token usage. Required.""" + """Is one of the following types: Literal[\"auto\"], Literal[\"low\"], Literal[\"high\"]""" + transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - cached_tokens: int, - text_tokens: int, - audio_tokens: int, - image_tokens: int, - cached_tokens_details: "_models.CachedTokenDetails", + type: Optional[Literal["input_text", "input_audio", "input_image"]] = None, + text: Optional[str] = None, + audio: Optional[str] = None, + image_url: Optional[str] = None, + detail: Optional[Literal["auto", "low", "high"]] = None, + transcript: Optional[str] = None, ) -> None: ... @overload @@ -3107,42 +3530,45 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InterimResponseConfigBase(_Model): - """Base model for interim response configuration. +class RealtimeFunctionToolParameters(_Model): + """RealtimeFunctionToolParameters.""" - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - LlmInterimResponseConfig, StaticInterimResponseConfig - :ivar type: The type of interim response configuration. Required. Known values are: - "static_interim_response" and "llm_interim_response". - :vartype type: str or ~azure.ai.voicelive.models.InterimResponseConfigType - :ivar triggers: List of triggers that can fire the interim response. Any trigger can activate - it (OR logic). Supported: 'latency', 'tool'. - :vartype triggers: list[str or ~azure.ai.voicelive.models.InterimResponseTrigger] - :ivar latency_threshold_ms: Latency threshold in milliseconds before triggering interim - response. Default is 2000ms. - :vartype latency_threshold_ms: int +class RealtimeMCPApprovalRequest(RealtimeConversationItem, discriminator="mcp_approval_request"): + """Realtime MCP approval request. + + :ivar type: The type of the item. Always ``mcp_approval_request``. Required. + MCP_APPROVAL_REQUEST. + :vartype type: str or ~azure.ai.voicelive.models.MCP_APPROVAL_REQUEST + :ivar id: The unique ID of the approval request. Required. + :vartype id: str + :ivar server_label: The label of the MCP server making the request. Required. + :vartype server_label: str + :ivar name: The name of the tool to run. Required. + :vartype name: str + :ivar arguments: A JSON string of arguments for the tool. Required. + :vartype arguments: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of interim response configuration. Required. Known values are: - \"static_interim_response\" and \"llm_interim_response\".""" - triggers: Optional[list[Union[str, "_models.InterimResponseTrigger"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """List of triggers that can fire the interim response. Any trigger can activate it (OR logic). - Supported: 'latency', 'tool'.""" - latency_threshold_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Latency threshold in milliseconds before triggering interim response. Default is 2000ms.""" + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_approval_request``. Required. MCP_APPROVAL_REQUEST.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval request. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server making the request. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the tool to run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of arguments for the tool. Required.""" @overload def __init__( self, *, - type: str, - triggers: Optional[list[Union[str, "_models.InterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, + id: str, # pylint: disable=redefined-builtin + server_label: str, + name: str, + arguments: str, ) -> None: ... @overload @@ -3154,128 +3580,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeConversationItemType.MCP_APPROVAL_REQUEST # type: ignore -class LlmInterimResponseConfig(InterimResponseConfigBase, discriminator="llm_interim_response"): - """Configuration for LLM-based interim response generation. Uses LLM to generate context-aware - interim responses when any trigger condition is met. +class RealtimeMCPApprovalResponse(RealtimeConversationItem, discriminator="mcp_approval_response"): + """Realtime MCP approval response. - :ivar triggers: List of triggers that can fire the interim response. Any trigger can activate - it (OR logic). Supported: 'latency', 'tool'. - :vartype triggers: list[str or ~azure.ai.voicelive.models.InterimResponseTrigger] - :ivar latency_threshold_ms: Latency threshold in milliseconds before triggering interim - response. Default is 2000ms. - :vartype latency_threshold_ms: int - :ivar type: Required. LLM-based interim response configuration type. - :vartype type: str or ~azure.ai.voicelive.models.LLM_INTERIM_RESPONSE - :ivar model: The model to use for LLM-based interim response generation. Default is - gpt-4.1-mini. - :vartype model: str - :ivar instructions: Custom instructions for generating interim responses. If not provided, a - default prompt is used. - :vartype instructions: str - :ivar max_completion_tokens: Maximum number of tokens to generate for the interim response. - :vartype max_completion_tokens: int - """ - - type: Literal[InterimResponseConfigType.LLM_INTERIM_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. LLM-based interim response configuration type.""" - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model to use for LLM-based interim response generation. Default is gpt-4.1-mini.""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Custom instructions for generating interim responses. If not provided, a default prompt is - used.""" - max_completion_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Maximum number of tokens to generate for the interim response.""" - - @overload - def __init__( - self, - *, - triggers: Optional[list[Union[str, "_models.InterimResponseTrigger"]]] = None, - latency_threshold_ms: Optional[int] = None, - model: Optional[str] = None, - instructions: Optional[str] = None, - max_completion_tokens: 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.type = InterimResponseConfigType.LLM_INTERIM_RESPONSE # type: ignore - - -class LogProbProperties(_Model): - """A single log probability entry for a token. - - :ivar token: The token that was used to generate the log probability. Required. - :vartype token: str - :ivar logprob: The log probability of the token. Required. - :vartype logprob: float - :ivar bytes: The bytes that were used to generate the log probability. Required. - :vartype bytes: list[int] - """ - - token: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The token that was used to generate the log probability. Required.""" - logprob: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The log probability of the token. Required.""" - bytes: list[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The bytes that were used to generate the log probability. Required.""" - - @overload - def __init__( - self, - *, - token: str, - logprob: float, - bytes: list[int], - ) -> 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 MCPApprovalResponseRequestItem(ConversationRequestItem, discriminator="mcp_approval_response"): - """A request item that represents a response to an MCP approval request. - - :ivar id: - :vartype id: str - :ivar type: The type of the item. Required. MCP_APPROVAL_RESPONSE. + :ivar type: The type of the item. Always ``mcp_approval_response``. Required. + MCP_APPROVAL_RESPONSE. :vartype type: str or ~azure.ai.voicelive.models.MCP_APPROVAL_RESPONSE - :ivar approval_request_id: The ID of the approval request. Required. + :ivar id: The unique ID of the approval response. Required. + :vartype id: str + :ivar approval_request_id: The ID of the approval request being answered. Required. :vartype approval_request_id: str - :ivar approve: Whether the tool call was approved. Required. + :ivar approve: Whether the request was approved. Required. :vartype approve: bool + :ivar reason: + :vartype reason: str """ - type: Literal[ItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Required. MCP_APPROVAL_RESPONSE.""" + type: Literal[RealtimeConversationItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_approval_response``. Required. MCP_APPROVAL_RESPONSE.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the approval response. Required.""" approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request. Required.""" + """The ID of the approval request being answered. Required.""" approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the tool call was approved. Required.""" + """Whether the request was approved. Required.""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, + id: str, # pylint: disable=redefined-builtin approval_request_id: str, approve: bool, - id: Optional[str] = None, # pylint: disable=redefined-builtin + reason: Optional[str] = None, ) -> None: ... @overload @@ -3287,54 +3628,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ItemType.MCP_APPROVAL_RESPONSE # type: ignore + self.type = RealtimeConversationItemType.MCP_APPROVAL_RESPONSE # type: ignore -class MCPServer(Tool, discriminator="mcp"): - """The definition of an MCP server as used by the voicelive endpoint. +class RealtimeMCPListTools(RealtimeConversationItem, discriminator="mcp_list_tools"): + """Realtime MCP list tools. - :ivar type: Required. MCP. - :vartype type: str or ~azure.ai.voicelive.models.MCP - :ivar server_label: Required. + :ivar type: The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS. + :vartype type: str or ~azure.ai.voicelive.models.MCP_LIST_TOOLS + :ivar id: The unique ID of the list. + :vartype id: str + :ivar server_label: The label of the MCP server. Required. :vartype server_label: str - :ivar server_url: Required. - :vartype server_url: str - :ivar authorization: - :vartype authorization: str - :ivar headers: - :vartype headers: dict[str, str] - :ivar allowed_tools: - :vartype allowed_tools: list[str] - :ivar require_approval: Is either a Union[str, "_models.MCPApprovalType"] type or a {str: - [str]} type. - :vartype require_approval: str or ~azure.ai.voicelive.models.MCPApprovalType or dict[str, - list[str]] + :ivar tools: The tools available on the server. Required. + :vartype tools: list[~azure.ai.voicelive.models.MCPListToolsTool] """ - type: Literal[ToolType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MCP.""" + type: Literal[RealtimeConversationItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_list_tools``. Required. MCP_LIST_TOOLS.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the list.""" server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - server_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - authorization: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - require_approval: Optional[Union[str, "_models.MCPApprovalType", dict[str, list[str]]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Is either a Union[str, \"_models.MCPApprovalType\"] type or a {str: [str]} type.""" + """The label of the MCP server. Required.""" + tools: list["_models.MCPListToolsTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tools available on the server. Required.""" @overload def __init__( self, *, server_label: str, - server_url: str, - authorization: Optional[str] = None, - headers: Optional[dict[str, str]] = None, - allowed_tools: Optional[list[str]] = None, - require_approval: Optional[Union[str, "_models.MCPApprovalType", dict[str, list[str]]]] = None, + tools: list["_models.MCPListToolsTool"], + id: Optional[str] = None, # pylint: disable=redefined-builtin ) -> None: ... @overload @@ -3346,39 +3671,55 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.MCP # type: ignore + self.type = RealtimeConversationItemType.MCP_LIST_TOOLS # type: ignore -class MCPTool(_Model): - """Represents a mcp tool definition. +class RealtimeMCPToolCall(RealtimeConversationItem, discriminator="mcp_call"): + """Realtime MCP tool call. - :ivar name: The name of the tool. Required. + :ivar type: The type of the item. Always ``mcp_call``. Required. MCP_CALL. + :vartype type: str or ~azure.ai.voicelive.models.MCP_CALL + :ivar id: The unique ID of the tool call. Required. + :vartype id: str + :ivar server_label: The label of the MCP server running the tool. Required. + :vartype server_label: str + :ivar name: The name of the tool that was run. Required. :vartype name: str - :ivar description: The description of the tool. - :vartype description: str - :ivar input_schema: The input schema for the tool. Required. - :vartype input_schema: any - :ivar annotations: The annotations for the tool. - :vartype annotations: any + :ivar arguments: A JSON string of the arguments passed to the tool. Required. + :vartype arguments: str + :ivar approval_request_id: + :vartype approval_request_id: str + :ivar output: + :vartype output: str + :ivar error: + :vartype error: ~azure.ai.voicelive.models.MCPError """ + type: Literal[RealtimeConversationItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always ``mcp_call``. Required. MCP_CALL.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the tool call. Required.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server running the tool. Required.""" name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool. Required.""" - description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The description of the tool.""" - input_schema: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The input schema for the tool. Required.""" - annotations: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The annotations for the tool.""" + """The name of the tool that was run. Required.""" + arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A JSON string of the arguments passed to the tool. Required.""" + approval_request_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + error: Optional["_models.MCPError"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, + id: str, # pylint: disable=redefined-builtin + server_label: str, name: str, - input_schema: Any, - description: Optional[str] = None, - annotations: Optional[Any] = None, + arguments: str, + approval_request_id: Optional[str] = None, + output: Optional[str] = None, + error: Optional["_models.MCPError"] = None, ) -> None: ... @overload @@ -3390,32 +3731,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = RealtimeConversationItemType.MCP_CALL # type: ignore -class OpenAIVoice(_Model): - """OpenAI voice configuration with explicit type field. - - This provides a unified interface for OpenAI voices, complementing the - existing string-based OAIVoice for backward compatibility. +class RealtimeReasoning(_Model): + """Realtime reasoning configuration. - :ivar type: The type of the voice. Required. Default value is "openai". - :vartype type: str - :ivar name: The name of the OpenAI voice. Required. Known values are: "alloy", "ash", "ballad", - "coral", "echo", "sage", "shimmer", "verse", "marin", and "cedar". - :vartype name: str or ~azure.ai.voicelive.models.OpenAIVoiceName + :ivar effort: Known values are: "minimal", "low", "medium", "high", and "xhigh". + :vartype effort: str or ~azure.ai.voicelive.models.ReasoningEffort """ - type: Literal["openai"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of the voice. Required. Default value is \"openai\".""" - name: Union[str, "_models.OpenAIVoiceName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the OpenAI voice. Required. Known values are: \"alloy\", \"ash\", \"ballad\", - \"coral\", \"echo\", \"sage\", \"shimmer\", \"verse\", \"marin\", and \"cedar\".""" + effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"minimal\", \"low\", \"medium\", \"high\", and \"xhigh\".""" @overload def __init__( self, *, - name: Union[str, "_models.OpenAIVoiceName"], + effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, ) -> None: ... @overload @@ -3427,28 +3762,118 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type: Literal["openai"] = "openai" -class OutputTextContentPart(MessageContentPart, discriminator="text"): - """Output text content part. +class RealtimeResponse(_Model): + """The response resource. - :ivar type: The type of the content part. Required. TEXT. - :vartype type: str or ~azure.ai.voicelive.models.TEXT - :ivar text: The text content. Required. - :vartype text: str + :ivar id: The unique ID of the response, will look like ``resp_1234``. + :vartype id: str + :ivar object: The object type, must be ``realtime.response``. Default value is + "realtime.response". + :vartype object: str + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str + :ivar status_details: Additional details about the status. + :vartype status_details: ~azure.ai.voicelive.models.ResponseStatusDetails + :ivar output: The list of output items generated by the response. + :vartype output: list[~azure.ai.voicelive.models.AzureResponseItem or + ~azure.ai.voicelive.models.MessageItem or ~azure.ai.voicelive.models.FunctionCallItem or + ~azure.ai.voicelive.models.FunctionCallOutputItem or + ~azure.ai.voicelive.models.RealtimeMCPToolCall or + ~azure.ai.voicelive.models.RealtimeMCPListTools or + ~azure.ai.voicelive.models.RealtimeMCPApprovalRequest or + ~azure.ai.voicelive.models.RealtimeMCPApprovalResponse] + :ivar metadata: + :vartype metadata: ~azure.ai.voicelive.models.Metadata + :ivar audio: Configuration for audio output. + :vartype audio: ~azure.ai.voicelive.models.ResponseAudio + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus + output from previous turns (text and audio tokens) will become the input for later turns. + :vartype usage: ~azure.ai.voicelive.models.RealtimeResponseUsage + :ivar conversation_id: Which conversation the response is added to, determined by the + ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be + added to the default conversation and the value of ``conversation_id`` will be an id like + ``conv_1234``. If ``none``, the response will not be added to any conversation and the value of + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. + :vartype conversation_id: str + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] + :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, + inclusive of tool calls, that was used in this response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str """ - type: Literal[ContentPartType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the content part. Required. TEXT.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text content. Required.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the response, will look like ``resp_1234``.""" + object: Optional[Literal["realtime.response"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The final status of the response (``completed``, ``cancelled``, ``failed``, or ``incomplete``, + ``in_progress``). Is one of the following types: Literal[\"completed\"], + Literal[\"cancelled\"], Literal[\"failed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + status_details: Optional["_models.ResponseStatusDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Additional details about the status.""" + output: Optional[list["_unions.ResponseItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The list of output items generated by the response.""" + metadata: Optional["_models.Metadata"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio: Optional["_models.ResponseAudio"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Configuration for audio output.""" + usage: Optional["_models.RealtimeResponseUsage"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Usage statistics for the Response, this will correspond to billing. A Realtime API session will + maintain a conversation context and append new Items to the Conversation, thus output from + previous turns (text and audio tokens) will become the input for later turns.""" + conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Which conversation the response is added to, determined by the ``conversation`` field in the + ``response.create`` event. If ``auto``, the response will be added to the default conversation + and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the + response will not be added to any conversation and the value of ``conversation_id`` will be + ``null``. If responses are being triggered automatically by VAD the response will be added to + the default conversation.""" + output_modalities: Optional[list[Literal["text", "audio"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The set of modalities the model used to respond, currently the only possible values are + ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text transcript. Setting the + output to mode ``text`` will disable audio output from the model.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that + was used in this response. Is either a int type or a Literal[\"inf\"] type.""" @overload def __init__( self, *, - text: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.response"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, + status_details: Optional["_models.ResponseStatusDetails"] = None, + output: Optional[list["_unions.ResponseItem"]] = None, + metadata: Optional["_models.Metadata"] = None, + audio: Optional["_models.ResponseAudio"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, + conversation_id: Optional[str] = None, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, ) -> None: ... @overload @@ -3460,34 +3885,42 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContentPartType.TEXT # type: ignore -class OutputTokenDetails(_Model): - """Details of output token usage. +class RealtimeResponseUsage(_Model): + """RealtimeResponseUsage. - :ivar text_tokens: Number of text tokens generated in the output. Required. - :vartype text_tokens: int - :ivar audio_tokens: Number of audio tokens generated in the output. Required. - :vartype audio_tokens: int - :ivar reasoning_tokens: Number of reasoning tokens generated in the output. - :vartype reasoning_tokens: int + :ivar total_tokens: + :vartype total_tokens: int + :ivar input_tokens: + :vartype input_tokens: int + :ivar output_tokens: + :vartype output_tokens: int + :ivar input_token_details: + :vartype input_token_details: ~azure.ai.voicelive.models.ResponseUsageInputTokenDetails + :ivar output_token_details: + :vartype output_token_details: ~azure.ai.voicelive.models.ResponseUsageOutputTokenDetails """ - text_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of text tokens generated in the output. Required.""" - audio_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of audio tokens generated in the output. Required.""" - reasoning_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of reasoning tokens generated in the output.""" + total_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + input_token_details: Optional["_models.ResponseUsageInputTokenDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + output_token_details: Optional["_models.ResponseUsageOutputTokenDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - text_tokens: int, - audio_tokens: int, - reasoning_tokens: Optional[int] = None, + total_tokens: Optional[int] = None, + input_tokens: Optional[int] = None, + output_tokens: Optional[int] = None, + input_token_details: Optional["_models.ResponseUsageInputTokenDetails"] = None, + output_token_details: Optional["_models.ResponseUsageOutputTokenDetails"] = None, ) -> None: ... @overload @@ -3501,36 +3934,58 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RequestAudioContentPart(ContentPart, discriminator="input_audio"): - """An audio content part for a request. This is supported only by realtime models (e.g., - gpt-realtime). For text-based models, use ``input_text`` instead. +class RealtimeTurnDetectionServerVad(TurnDetection, discriminator="server_vad"): + """RealtimeTurnDetectionServerVad. - :ivar type: Required. INPUT_AUDIO. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO - :ivar audio: Base64-encoded audio bytes, these will be parsed as the format specified in the - session input audio type configuration. This defaults to PCM 16-bit 24kHz mono if not - specified. Required. - :vartype audio: str - :ivar transcript: Optional transcript of the audio content. This is not sent to the model, but - will be attached to the message item for reference. - :vartype transcript: str + :ivar type: Required. SERVER_VAD. + :vartype type: str or ~azure.ai.voicelive.models.SERVER_VAD + :ivar threshold: + :vartype threshold: float + :ivar prefix_padding_ms: + :vartype prefix_padding_ms: int + :ivar silence_duration_ms: + :vartype silence_duration_ms: int + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + :ivar idle_timeout_ms: + :vartype idle_timeout_ms: int + :ivar end_of_utterance_detection: Configuration for end-of-utterance detection (Azure + extension). + :vartype end_of_utterance_detection: ~azure.ai.voicelive.models.EouDetection + :ivar auto_truncate: Whether to automatically truncate the audio buffer when speech stops + (Azure extension). + :vartype auto_truncate: bool """ - type: Literal[ContentPartType.INPUT_AUDIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. INPUT_AUDIO.""" - audio: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Base64-encoded audio bytes, these will be parsed as the format specified in the session input - audio type configuration. This defaults to PCM 16-bit 24kHz mono if not specified. Required.""" - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional transcript of the audio content. This is not sent to the model, but will be attached - to the message item for reference.""" + type: Literal[TurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SERVER_VAD.""" + threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + idle_timeout_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + end_of_utterance_detection: Optional["_models.EouDetection"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for end-of-utterance detection (Azure extension).""" + auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to automatically truncate the audio buffer when speech stops (Azure extension).""" @overload def __init__( self, *, - audio: str, - transcript: Optional[str] = None, + threshold: Optional[float] = None, + prefix_padding_ms: Optional[int] = None, + silence_duration_ms: Optional[int] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = None, + idle_timeout_ms: Optional[int] = None, + end_of_utterance_detection: Optional["_models.EouDetection"] = None, + auto_truncate: Optional[bool] = None, ) -> None: ... @overload @@ -3542,116 +3997,53 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContentPartType.INPUT_AUDIO # type: ignore + self.type = TurnDetectionType.SERVER_VAD # type: ignore -class RequestImageContentPart(ContentPart, discriminator="input_image"): - """Input image content part. +class RequestSession(_Model): + """VoiceLive v1 realtime session configuration. - :ivar type: Required. INPUT_IMAGE. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_IMAGE - :ivar image_url: - :vartype image_url: str - :ivar detail: Known values are: "auto", "low", and "high". - :vartype detail: str or ~azure.ai.voicelive.models.RequestImageContentPartDetail - """ - - type: Literal[ContentPartType.INPUT_IMAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. INPUT_IMAGE.""" - image_url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - detail: Optional[Union[str, "_models.RequestImageContentPartDetail"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Known values are: \"auto\", \"low\", and \"high\".""" - - @overload - def __init__( - self, - *, - image_url: Optional[str] = None, - detail: Optional[Union[str, "_models.RequestImageContentPartDetail"]] = 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 = ContentPartType.INPUT_IMAGE # type: ignore - - -class RequestSession(_Model): - """Base for session configuration shared between request and response. - - :ivar model: The model for the session. - :vartype model: str - :ivar modalities: The modalities to be used in the session. - :vartype modalities: list[str or ~azure.ai.voicelive.models.Modality] + :ivar type: The session type. VoiceLive v1 supports realtime sessions only. Required. Default + value is "realtime". + :vartype type: str + :ivar output_modalities: Modalities the service may return. + :vartype output_modalities: list[str or ~azure.ai.voicelive.models.SessionModality] + :ivar instructions: Session instructions. + :vartype instructions: str + :ivar audio: Nested input and output audio configuration. + :vartype audio: ~azure.ai.voicelive.models.AudioConfig + :ivar include: Additional fields to include in server outputs. + :vartype include: list[str] + :ivar tools: Tools available to the model. + :vartype tools: list[~azure.ai.voicelive.models.FunctionTool or + ~azure.ai.voicelive.models.VoiceLiveMcpTool] + :ivar tool_choice: Tool selection behavior. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.voicelive.models.ToolChoiceOptions or + ~azure.ai.voicelive.models.ToolChoiceFunction or ~azure.ai.voicelive.models.ToolChoiceMCP + :ivar parallel_tool_calls: Whether multiple tool calls may run in parallel. + :vartype parallel_tool_calls: bool + :ivar reasoning: Reasoning configuration for compatible realtime models. + :vartype reasoning: ~azure.ai.voicelive.models.RealtimeReasoning + :ivar max_output_tokens: Maximum output tokens for one response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str :ivar animation: The animation configuration for the session. :vartype animation: ~azure.ai.voicelive.models.Animation - :ivar voice: The voice configuration for the session. Is one of the following types: Union[str, - "_models.OpenAIVoiceName"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice - :vartype voice: str or ~azure.ai.voicelive.models.OpenAIVoiceName or - ~azure.ai.voicelive.models.OpenAIVoice or ~azure.ai.voicelive.models.AzureVoice or - ~azure.ai.voicelive.models.AzureRealtimeNativeVoice - :ivar instructions: Optional instructions to guide the model's behavior throughout the session. - :vartype instructions: str - :ivar input_audio_sampling_rate: Input audio sampling rate in Hz. Available values: - - * For pcm16: 8000, 16000, 24000 - - * For g711_alaw/g711_ulaw: 8000. - :vartype input_audio_sampling_rate: int - :ivar input_audio_format: Input audio format. Default is 'pcm16'. Known values are: "pcm16", - "g711_ulaw", and "g711_alaw". - :vartype input_audio_format: str or ~azure.ai.voicelive.models.InputAudioFormat - :ivar output_audio_format: Output audio format. Default is 'pcm16'. Known values are: "pcm16", - "pcm16_8000hz", "pcm16_16000hz", "g711_ulaw", and "g711_alaw". - :vartype output_audio_format: str or ~azure.ai.voicelive.models.OutputAudioFormat - :ivar turn_detection: Type of turn detection to use. - :vartype turn_detection: ~azure.ai.voicelive.models.TurnDetection - :ivar input_audio_noise_reduction: Configuration for input audio noise reduction. - :vartype input_audio_noise_reduction: ~azure.ai.voicelive.models.AudioNoiseReduction - :ivar input_audio_echo_cancellation: Configuration for echo cancellation during server-side - audio processing. - :vartype input_audio_echo_cancellation: ~azure.ai.voicelive.models.AudioEchoCancellation :ivar avatar: Configuration for avatar streaming and behavior during the session. :vartype avatar: ~azure.ai.voicelive.models.AvatarConfig - :ivar input_audio_transcription: Configuration for input audio transcription. - :vartype input_audio_transcription: ~azure.ai.voicelive.models.AudioInputTranscriptionOptions - :ivar output_audio_timestamp_types: Types of timestamps to include in audio response content. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.voicelive.models.AudioTimestampType] - :ivar tools: Configuration for tools to be used during the session, if applicable. - :vartype tools: list[~azure.ai.voicelive.models.Tool] - :ivar tool_choice: Specifies which tools the model is allowed to call during the session. Is - either a Union[str, "_models.ToolChoiceLiteral"] type or a ToolChoiceSelection type. - :vartype tool_choice: str or ~azure.ai.voicelive.models.ToolChoiceLiteral or - ~azure.ai.voicelive.models.ToolChoiceSelection - :ivar parallel_tool_calls: Whether the model is allowed to call tools in parallel. - :vartype parallel_tool_calls: bool - :ivar temperature: Controls the randomness of the model's output. Range: 0.0 to 1.0. Default is - 0.7. + :ivar temperature: Controls randomness for compatible cascaded pipelines. Native realtime + pipelines reject this property because the upstream realtime API does not support session + temperature. :vartype temperature: float - :ivar max_response_output_tokens: Maximum number of tokens to generate in the response. Default - is unlimited. Is either a int type or a Literal["inf"] type. - :vartype max_response_output_tokens: int or str - :ivar reasoning_effort: Constrains effort on reasoning for reasoning models. Check model - documentation for supported 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". - :vartype reasoning_effort: str or ~azure.ai.voicelive.models.ReasoningEffort :ivar interim_response: Configuration for interim response generation during latency or tool 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 include: List of include options for the session (e.g., logprobs, phrases, file search - results). - :vartype include: list[str or ~azure.ai.voicelive.models.SessionIncludeOption] + :ivar voice_adaptation: Voice-optimized instruction adaptation. + :vartype voice_adaptation: ~azure.ai.voicelive.models.VoiceAdaptation + :ivar response_delimiter: Delimiter appended to generated responses. + :vartype response_delimiter: str :ivar metadata: Set of up to 16 key-value pairs that can be attached to the session. This is useful for storing additional information about the session in a structured format, such as tracking IDs, user context, or application-specific labels. These key-value pairs are also @@ -3660,87 +4052,56 @@ class RequestSession(_Model): :vartype metadata: dict[str, str] """ - model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The model for the session.""" - modalities: Optional[list[Union[str, "_models.Modality"]]] = rest_field( + type: Literal["realtime"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session type. VoiceLive v1 supports realtime sessions only. Required. Default value is + \"realtime\".""" + output_modalities: Optional[list[Union[str, "_models.SessionModality"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """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["_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""" + """Modalities the service may return.""" instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Optional instructions to guide the model's behavior throughout the session.""" - input_audio_sampling_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input audio sampling rate in Hz. Available values: - - * For pcm16: 8000, 16000, 24000 - - * For g711_alaw/g711_ulaw: 8000.""" - input_audio_format: Optional[Union[str, "_models.InputAudioFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input audio format. Default is 'pcm16'. Known values are: \"pcm16\", \"g711_ulaw\", and - \"g711_alaw\".""" - output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = rest_field( + """Session instructions.""" + audio: Optional["_models.AudioConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Nested input and output audio configuration.""" + include: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional fields to include in server outputs.""" + tools: Optional[list["_unions.VoiceLiveTool"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Output audio format. Default is 'pcm16'. Known values are: \"pcm16\", \"pcm16_8000hz\", - \"pcm16_16000hz\", \"g711_ulaw\", and \"g711_alaw\".""" - turn_detection: Optional["_models.TurnDetection"] = rest_field( + """Tools available to the model.""" + tool_choice: Optional["_unions.VoiceLiveToolChoice"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Type of turn detection to use.""" - input_audio_noise_reduction: Optional["_models.AudioNoiseReduction"] = rest_field( + """Tool selection behavior. Is one of the following types: Union[str, + \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether multiple tool calls may run in parallel.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for input audio noise reduction.""" - input_audio_echo_cancellation: Optional["_models.AudioEchoCancellation"] = rest_field( + """Reasoning configuration for compatible realtime models.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Configuration for echo cancellation during server-side audio processing.""" + """Maximum output tokens for one response. Is either a int type or a Literal[\"inf\"] type.""" + animation: Optional["_models.Animation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The animation configuration for the session.""" avatar: Optional["_models.AvatarConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Configuration for avatar streaming and behavior during the session.""" - input_audio_transcription: Optional["_models.AudioInputTranscriptionOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for input audio transcription.""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.AudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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["_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"]) - """Whether the model is allowed to call tools in parallel.""" temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Controls the randomness of the model's output. Range: 0.0 to 1.0. Default is 0.7.""" - max_response_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of tokens to generate in the response. Default is unlimited. Is either a int - type or a Literal[\"inf\"] type.""" - reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Constrains effort on reasoning for reasoning models. Check model documentation for supported - 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\".""" + """Controls randomness for compatible cascaded pipelines. Native realtime pipelines reject this + property because the upstream realtime API does not support session temperature.""" 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.""" - include: Optional[list[Union[str, "_models.SessionIncludeOption"]]] = rest_field( + voice_adaptation: Optional["_models.VoiceAdaptation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of include options for the session (e.g., logprobs, phrases, file search results).""" + """Voice-optimized instruction adaptation.""" + response_delimiter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Delimiter appended to generated responses.""" metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Set of up to 16 key-value pairs that can be attached to the session. This is useful for storing additional information about the session in a structured format, such as tracking IDs, user @@ -3752,28 +4113,21 @@ class RequestSession(_Model): def __init__( self, *, - model: Optional[str] = None, - modalities: Optional[list[Union[str, "_models.Modality"]]] = None, - animation: Optional["_models.Animation"] = None, - voice: Optional["_unions.Voice"] = None, + output_modalities: Optional[list[Union[str, "_models.SessionModality"]]] = None, instructions: Optional[str] = None, - input_audio_sampling_rate: Optional[int] = None, - input_audio_format: Optional[Union[str, "_models.InputAudioFormat"]] = None, - output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = None, - turn_detection: Optional["_models.TurnDetection"] = None, - input_audio_noise_reduction: Optional["_models.AudioNoiseReduction"] = None, - input_audio_echo_cancellation: Optional["_models.AudioEchoCancellation"] = None, - avatar: Optional["_models.AvatarConfig"] = None, - 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["_unions.ToolChoice"] = None, + audio: Optional["_models.AudioConfig"] = None, + include: Optional[list[str]] = None, + tools: Optional[list["_unions.VoiceLiveTool"]] = None, + tool_choice: Optional["_unions.VoiceLiveToolChoice"] = None, parallel_tool_calls: Optional[bool] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + animation: Optional["_models.Animation"] = None, + avatar: Optional["_models.AvatarConfig"] = 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["_unions.InterimResponseConfig"] = None, - include: Optional[list[Union[str, "_models.SessionIncludeOption"]]] = None, + voice_adaptation: Optional["_models.VoiceAdaptation"] = None, + response_delimiter: Optional[str] = None, metadata: Optional[dict[str, str]] = None, ) -> None: ... @@ -3786,151 +4140,66 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["realtime"] = "realtime" -class RequestTextContentPart(ContentPart, discriminator="input_text"): - """A text content part for a request. - - :ivar type: Required. INPUT_TEXT. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_TEXT - :ivar text: - :vartype text: str - """ - - type: Literal[ContentPartType.INPUT_TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. INPUT_TEXT.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - text: 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 = ContentPartType.INPUT_TEXT # type: ignore - - -class Response(_Model): - """The response resource. +class Response(RealtimeResponse): + """The response resource: the OpenAI GA Realtime response (``RealtimeResponse``) plus Azure + extensions. The inherited ``output`` list is retyped to VoiceLive's ``ResponseItem`` union so + standard message, function, and MCP items are preserved; preview additionally includes Azure + web/file-search items. VoiceLive migrates from the beta response shape to GA: + ``modalities``/``output_audio_format``/``voice`` are replaced by the inherited GA + ``output_modalities`` and nested ``audio``. - :ivar id: The unique ID of the response. + :ivar id: The unique ID of the response, will look like ``resp_1234``. :vartype id: str :ivar object: The object type, must be ``realtime.response``. Default value is "realtime.response". :vartype object: str - :ivar status: The final status of the response. - - One of: ``completed``, ``cancelled``, ``failed``, ``incomplete``, or ``in_progress``. Known - values are: "completed", "cancelled", "failed", "incomplete", and "in_progress". - :vartype status: str or ~azure.ai.voicelive.models.ResponseStatus + :ivar status: The final status of the response (``completed``, ``cancelled``, ``failed``, or + ``incomplete``, ``in_progress``). Is one of the following types: Literal["completed"], + Literal["cancelled"], Literal["failed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str or str or str :ivar status_details: Additional details about the status. :vartype status_details: ~azure.ai.voicelive.models.ResponseStatusDetails :ivar output: The list of output items generated by the response. - :vartype output: list[~azure.ai.voicelive.models.ResponseItem] - :ivar usage: Usage statistics for the Response, this will correspond to billing. A VoiceLive - API session will maintain a conversation context and append new Items to the Conversation, thus + :vartype output: list[~azure.ai.voicelive.models.AzureResponseItem or + ~azure.ai.voicelive.models.MessageItem or ~azure.ai.voicelive.models.FunctionCallItem or + ~azure.ai.voicelive.models.FunctionCallOutputItem or + ~azure.ai.voicelive.models.RealtimeMCPToolCall or + ~azure.ai.voicelive.models.RealtimeMCPListTools or + ~azure.ai.voicelive.models.RealtimeMCPApprovalRequest or + ~azure.ai.voicelive.models.RealtimeMCPApprovalResponse] + :ivar metadata: + :vartype metadata: ~azure.ai.voicelive.models.Metadata + :ivar audio: Configuration for audio output. + :vartype audio: ~azure.ai.voicelive.models.ResponseAudio + :ivar usage: Usage statistics for the Response, this will correspond to billing. A Realtime API + session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns. - :vartype usage: ~azure.ai.voicelive.models.TokenUsage + :vartype usage: ~azure.ai.voicelive.models.RealtimeResponseUsage :ivar conversation_id: Which conversation the response is added to, determined by the ``conversation`` field in the ``response.create`` event. If ``auto``, the response will be added to the default conversation and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the 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``. + ``conversation_id`` will be ``null``. If responses are being triggered automatically by VAD the + response will be added to the default conversation. :vartype conversation_id: str - :ivar voice: supported voice identifiers and configurations. Is one of the following types: - Union[str, "_models.OpenAIVoiceName"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice - :vartype voice: str or ~azure.ai.voicelive.models.OpenAIVoiceName or - ~azure.ai.voicelive.models.OpenAIVoice or ~azure.ai.voicelive.models.AzureVoice or - ~azure.ai.voicelive.models.AzureRealtimeNativeVoice - :ivar modalities: The set of modalities the model used to respond. If there are multiple - modalities, the model will pick one, for example if ``modalities`` is ``["text", "audio"]``, - the model could be responding in either text or audio. - :vartype modalities: list[str or ~azure.ai.voicelive.models.Modality] - :ivar output_audio_format: The format of output audio. Options are ``pcm16``, ``g711_ulaw``, or - ``g711_alaw``. Known values are: "pcm16", "pcm16_8000hz", "pcm16_16000hz", "g711_ulaw", and - "g711_alaw". - :vartype output_audio_format: str or ~azure.ai.voicelive.models.OutputAudioFormat - :ivar temperature: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - :vartype temperature: float + :ivar output_modalities: The set of modalities the model used to respond, currently the only + possible values are ``[\\"audio\\"]``, ``[\\"text\\"]``. Audio output always include a text + transcript. Setting the output to mode ``text`` will disable audio output from the model. + :vartype output_modalities: list[str or str] :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response. Is either a int type or a Literal["inf"] type. :vartype max_output_tokens: int or str - :ivar metadata: 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. - :vartype metadata: dict[str, str] + :ivar temperature: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + (Azure extension). + :vartype temperature: float """ - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The unique ID of the response.""" - object: Optional[Literal["realtime.response"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The object type, must be ``realtime.response``. Default value is \"realtime.response\".""" - status: Optional[Union[str, "_models.ResponseStatus"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The final status of the response. - - One of: ``completed``, ``cancelled``, ``failed``, ``incomplete``, or ``in_progress``. Known - values are: \"completed\", \"cancelled\", \"failed\", \"incomplete\", and \"in_progress\".""" - status_details: Optional["_models.ResponseStatusDetails"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Additional details about the status.""" - output: Optional[list["_models.ResponseItem"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The list of output items generated by the response.""" - usage: Optional["_models.TokenUsage"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Usage statistics for the Response, this will correspond to billing. A VoiceLive API session - will maintain a conversation context and append new Items to the Conversation, thus output from - previous turns (text and audio tokens) will become the input for later turns.""" - conversation_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Which conversation the response is added to, determined by the ``conversation`` field in the - ``response.create`` event. If ``auto``, the response will be added to the default conversation - and the value of ``conversation_id`` will be an id like ``conv_1234``. If ``none``, the - 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["_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( - visibility=["read", "create", "update", "delete", "query"] - ) - """The set of modalities the model used to respond. If there are multiple modalities, the model - will pick one, for example if ``modalities`` is ``[\"text\", \"audio\"]``, the model could be - responding in either text or audio.""" - output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The format of output audio. Options are ``pcm16``, ``g711_ulaw``, or ``g711_alaw``. Known - values are: \"pcm16\", \"pcm16_8000hz\", \"pcm16_16000hz\", \"g711_ulaw\", and \"g711_alaw\".""" temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.""" - max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of output tokens for a single assistant response, inclusive of tool calls, that - was used in this response. Is either a int type or a Literal[\"inf\"] type.""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" + """Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. (Azure extension).""" @overload def __init__( @@ -3938,17 +4207,16 @@ def __init__( *, id: Optional[str] = None, # pylint: disable=redefined-builtin object: Optional[Literal["realtime.response"]] = None, - status: Optional[Union[str, "_models.ResponseStatus"]] = None, + status: Optional[Literal["completed", "cancelled", "failed", "incomplete", "in_progress"]] = None, status_details: Optional["_models.ResponseStatusDetails"] = None, - output: Optional[list["_models.ResponseItem"]] = None, - usage: Optional["_models.TokenUsage"] = None, + output: Optional[list["_unions.ResponseItem"]] = None, + metadata: Optional["_models.Metadata"] = None, + audio: Optional["_models.ResponseAudio"] = None, + usage: Optional["_models.RealtimeResponseUsage"] = None, conversation_id: Optional[str] = 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, + output_modalities: Optional[list[Literal["text", "audio"]]] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - metadata: Optional[dict[str, str]] = None, + temperature: Optional[float] = None, ) -> None: ... @overload @@ -3962,24 +4230,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseAudioContentPart(ContentPart, discriminator="audio"): - """An audio content part for a response. +class ResponseAudio(_Model): + """ResponseAudio. - :ivar type: Required. AUDIO. - :vartype type: str or ~azure.ai.voicelive.models.AUDIO - :ivar transcript: - :vartype transcript: str + :ivar output: + :vartype output: ~azure.ai.voicelive.models.ResponseAudioOutput """ - type: Literal[ContentPartType.AUDIO] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. AUDIO.""" - transcript: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + output: Optional["_models.ResponseAudioOutput"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - transcript: Optional[str] = None, + output: Optional["_models.ResponseAudioOutput"] = None, ) -> None: ... @overload @@ -3991,30 +4257,31 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ContentPartType.AUDIO # type: ignore -class ResponseStatusDetails(_Model): - """Base for all non-success response details. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponseCancelledDetails, ResponseFailedDetails, ResponseIncompleteDetails +class ResponseAudioOutput(_Model): + """ResponseAudioOutput. - :ivar type: Required. Known values are: "completed", "cancelled", "failed", "incomplete", and - "in_progress". - :vartype type: str or ~azure.ai.voicelive.models.ResponseStatus + :ivar format: + :vartype format: ~azure.ai.voicelive.models.AudioFormats + :ivar voice: Known values are: "alloy", "ash", "ballad", "coral", "echo", "sage", "shimmer", + "verse", "marin", and "cedar". + :vartype voice: str or ~azure.ai.voicelive.models.VoiceIdsShared """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"completed\", \"cancelled\", \"failed\", \"incomplete\", and - \"in_progress\".""" + format: Optional["_models.AudioFormats"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + voice: Optional[Union[str, "_models.VoiceIdsShared"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"alloy\", \"ash\", \"ballad\", \"coral\", \"echo\", \"sage\", \"shimmer\", + \"verse\", \"marin\", and \"cedar\".""" @overload def __init__( self, *, - type: str, + format: Optional["_models.AudioFormats"] = None, + voice: Optional[Union[str, "_models.VoiceIdsShared"]] = None, ) -> None: ... @overload @@ -4028,29 +4295,23 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseCancelledDetails(ResponseStatusDetails, discriminator="cancelled"): - """Details for a cancelled response. +class ResponseCreateAudio(_Model): + """Response-level audio configuration. - :ivar type: Required. CANCELLED. - :vartype type: str or ~azure.ai.voicelive.models.CANCELLED - :ivar reason: Required. Is one of the following types: Literal["turn_detected"], - Literal["client_cancelled"], str - :vartype reason: str or str or str + :ivar output: Output audio configuration for this response. + :vartype output: ~azure.ai.voicelive.models.AudioOutputConfig """ - type: Literal[ResponseStatus.CANCELLED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. CANCELLED.""" - reason: Union[Literal["turn_detected"], Literal["client_cancelled"], str] = rest_field( + output: Optional["_models.AudioOutputConfig"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Is one of the following types: Literal[\"turn_detected\"], - Literal[\"client_cancelled\"], str""" + """Output audio configuration for this response.""" @overload def __init__( self, *, - reason: Union[Literal["turn_detected"], Literal["client_cancelled"], str], + output: Optional["_models.AudioOutputConfig"] = None, ) -> None: ... @overload @@ -4062,177 +4323,159 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStatus.CANCELLED # type: ignore class ResponseCreateParams(_Model): - """Create a new VoiceLive response with these parameters. - - :ivar commit: Whether to commit the response to the conversation. Defaults to true. - :vartype commit: bool - :ivar cancel_previous: Whether to cancel any ongoing generation before starting this one. - Defaults to true. - :vartype cancel_previous: bool - :ivar append_input_items: Input items to append to the conversation context before generating a - response. - :vartype append_input_items: list[~azure.ai.voicelive.models.ConversationRequestItem] - :ivar input_items: Input items to be used as the context for this response. An empty array - clears previous context. - :vartype input_items: list[~azure.ai.voicelive.models.ConversationRequestItem] - :ivar modalities: The set of modalities the model can respond with. To disable audio, set this - to ["text"]. - :vartype modalities: list[str or ~azure.ai.voicelive.models.Modality] - :ivar instructions: The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired - responses. The model can be instructed on response content and format, - (e.g. "be extremely succinct", "act friendly", "here are examples of good - responses") and on audio behavior (e.g. "talk quickly", "inject emotion - into your voice", "laugh frequently"). The instructions are not guaranteed - to be followed by the model, but they provide guidance to the model on the - desired behavior. - - 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. + """Create a new VoiceLive response using the OpenAI Realtime GA wire shape. + + :ivar conversation: Whether this response is added to the default conversation. Known values + are: "auto" and "none". + :vartype conversation: str or ~azure.ai.voicelive.models.ResponseConversation + :ivar input: Inline GA conversation context for this response. + :vartype input: list[~azure.ai.voicelive.models.MessageItem or + ~azure.ai.voicelive.models.FunctionCallItem or + ~azure.ai.voicelive.models.FunctionCallOutputItem or + ~azure.ai.voicelive.models.RealtimeMCPApprovalResponse] + :ivar instructions: Instructions applied only to this response. :vartype instructions: str - :ivar voice: supported voice identifiers and configurations. Is one of the following types: - Union[str, "_models.OpenAIVoiceName"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice - :vartype voice: str or ~azure.ai.voicelive.models.OpenAIVoiceName or - ~azure.ai.voicelive.models.OpenAIVoice or ~azure.ai.voicelive.models.AzureVoice or - ~azure.ai.voicelive.models.AzureRealtimeNativeVoice - :ivar output_audio_format: The format of output audio. Options are ``pcm16``, ``g711_ulaw``, or - ``g711_alaw``. Known values are: "pcm16", "pcm16_8000hz", "pcm16_16000hz", "g711_ulaw", and - "g711_alaw". - :vartype output_audio_format: str or ~azure.ai.voicelive.models.OutputAudioFormat - :ivar tools: Tools (functions) available to the model. - :vartype tools: list[~azure.ai.voicelive.models.Tool] - :ivar tool_choice: How the model chooses tools. Options are ``auto``, ``none``, ``required``, - or specify a function, like ``{"type": "function", "function": {"name": "my_function"}}``. - :vartype tool_choice: str - :ivar temperature: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - :vartype temperature: float - :ivar max_output_tokens: Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or - ``inf`` for the maximum available tokens for a given model. Defaults to ``inf``. Is either a - int type or a Literal["inf"] type. + :ivar max_output_tokens: Maximum output tokens for this response. Is either a int type or a + Literal["inf"] type. :vartype max_output_tokens: int or str - :ivar pre_generated_assistant_message: Create the response with pre-generated assistant - message. The message item would be added into the conversation history and returned with - synthesized audio output in the created response. - :vartype pre_generated_assistant_message: ~azure.ai.voicelive.models.AssistantMessageItem - :ivar reasoning_effort: Constrains effort on reasoning for reasoning models. Check model - documentation for supported 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". - :vartype reasoning_effort: str or ~azure.ai.voicelive.models.ReasoningEffort - :ivar metadata: 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. + :ivar metadata: Up to 16 string key-value metadata pairs. :vartype metadata: dict[str, str] + :ivar output_modalities: Modalities the response may return. + :vartype output_modalities: list[str or ~azure.ai.voicelive.models.SessionModality] + :ivar audio: Response-level audio output configuration. + :vartype audio: ~azure.ai.voicelive.models.ResponseCreateAudio + :ivar tools: Function tools available for this response. + :vartype tools: list[~azure.ai.voicelive.models.FunctionTool] + :ivar tool_choice: Tool selection behavior for this response. Is one of the following types: + Union[str, "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.voicelive.models.ToolChoiceOptions or + ~azure.ai.voicelive.models.ToolChoiceFunction or ~azure.ai.voicelive.models.ToolChoiceMCP + :ivar pre_generated_assistant_message: Create the response with a pre-generated assistant + message. + :vartype pre_generated_assistant_message: ~azure.ai.voicelive.models.AssistantMessageItem :ivar interim_response: Configuration for interim response generation during latency or tool 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. + :ivar parallel_tool_calls: Whether compatible realtime models may call tools in parallel. + :vartype parallel_tool_calls: bool + :ivar reasoning: Reasoning configuration for compatible realtime models. + :vartype reasoning: ~azure.ai.voicelive.models.RealtimeReasoning + :ivar commit: Preview response-commit behavior. Use ``conversation`` in v1. + :vartype commit: bool + :ivar cancel_previous: Preview cancellation behavior. Send ``response.cancel`` explicitly in + v1. + :vartype cancel_previous: bool + :ivar append_input_items: Preview input append behavior. Build the v1 ``input`` list + explicitly. + :vartype append_input_items: list[~azure.ai.voicelive.models.MessageItem or + ~azure.ai.voicelive.models.FunctionCallItem or + ~azure.ai.voicelive.models.FunctionCallOutputItem or + ~azure.ai.voicelive.models.RealtimeMCPApprovalResponse] + :ivar input_items: Preview response input field. An empty array clears context; use ``input`` + in v1. + :vartype input_items: list[~azure.ai.voicelive.models.MessageItem or + ~azure.ai.voicelive.models.FunctionCallItem or + ~azure.ai.voicelive.models.FunctionCallOutputItem or + ~azure.ai.voicelive.models.RealtimeMCPApprovalResponse] + :ivar temperature: Preview response-level temperature. Configure compatible cascaded v1 + sessions instead. + :vartype temperature: float + :ivar invoke_input: Preview hosted-agent invocation input. Hosted agents are excluded from v1. :vartype invoke_input: dict[str, any] """ - commit: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to commit the response to the conversation. Defaults to true.""" - cancel_previous: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to cancel any ongoing generation before starting this one. Defaults to true.""" - append_input_items: Optional[list["_models.ConversationRequestItem"]] = rest_field( + conversation: Optional[Union[str, "_models.ResponseConversation"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Input items to append to the conversation context before generating a response.""" - input_items: Optional[list["_models.ConversationRequestItem"]] = rest_field( + """Whether this response is added to the default conversation. Known values are: \"auto\" and + \"none\".""" + input: Optional[list["_unions.ConversationRequestItem"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Input items to be used as the context for this response. An empty array clears previous - context.""" - modalities: Optional[list[Union[str, "_models.Modality"]]] = rest_field( + """Inline GA conversation context for this response.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Instructions applied only to this response.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The set of modalities the model can respond with. To disable audio, set this to [\"text\"].""" - instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired - responses. The model can be instructed on response content and format, - (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good - responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion - into your voice\", \"laugh frequently\"). The instructions are not guaranteed - to be followed by the model, but they provide guidance to the model on the - desired behavior. - - 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["_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( + """Maximum output tokens for this response. Is either a int type or a Literal[\"inf\"] type.""" + metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Up to 16 string key-value metadata pairs.""" + output_modalities: Optional[list[Union[str, "_models.SessionModality"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The format of output audio. Options are ``pcm16``, ``g711_ulaw``, or ``g711_alaw``. Known - values are: \"pcm16\", \"pcm16_8000hz\", \"pcm16_16000hz\", \"g711_ulaw\", and \"g711_alaw\".""" - tools: Optional[list["_models.Tool"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Tools (functions) available to the model.""" - tool_choice: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """How the model chooses tools. Options are ``auto``, ``none``, ``required``, or specify a - function, like ``{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}``.""" - temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.""" - max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( + """Modalities the response may return.""" + audio: Optional["_models.ResponseCreateAudio"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Maximum number of output tokens for a single assistant response, inclusive of tool calls. - Provide an integer between 1 and 4096 to limit output tokens, or ``inf`` for the maximum - available tokens for a given model. Defaults to ``inf``. Is either a int type or a - Literal[\"inf\"] type.""" - pre_generated_assistant_message: Optional["_models.AssistantMessageItem"] = rest_field( + """Response-level audio output configuration.""" + tools: Optional[list["_models.FunctionTool"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Create the response with pre-generated assistant message. The message item would be added into - the conversation history and returned with synthesized audio output in the created response.""" - reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( + """Function tools available for this response.""" + tool_choice: Optional["_unions.VoiceLiveToolChoice"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Constrains effort on reasoning for reasoning models. Check model documentation for supported - 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\".""" - metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """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.""" + """Tool selection behavior for this response. Is one of the following types: Union[str, + \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + pre_generated_assistant_message: Optional["_models.AssistantMessageItem"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Create the response with a pre-generated assistant message.""" 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.""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether compatible realtime models may call tools in parallel.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Reasoning configuration for compatible realtime models.""" + commit: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preview response-commit behavior. Use ``conversation`` in v1.""" + cancel_previous: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preview cancellation behavior. Send ``response.cancel`` explicitly in v1.""" + append_input_items: Optional[list["_unions.ConversationRequestItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Preview input append behavior. Build the v1 ``input`` list explicitly.""" + input_items: Optional[list["_unions.ConversationRequestItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Preview response input field. An empty array clears context; use ``input`` in v1.""" + temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Preview response-level temperature. Configure compatible cascaded v1 sessions instead.""" invoke_input: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input data to invoke the hosted agent.""" + """Preview hosted-agent invocation input. Hosted agents are excluded from v1.""" @overload def __init__( self, *, - commit: Optional[bool] = None, - cancel_previous: Optional[bool] = None, - append_input_items: Optional[list["_models.ConversationRequestItem"]] = None, - input_items: Optional[list["_models.ConversationRequestItem"]] = None, - modalities: Optional[list[Union[str, "_models.Modality"]]] = None, + conversation: Optional[Union[str, "_models.ResponseConversation"]] = None, + input: Optional[list["_unions.ConversationRequestItem"]] = None, instructions: Optional[str] = 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, - temperature: Optional[float] = None, max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, - pre_generated_assistant_message: Optional["_models.AssistantMessageItem"] = None, - reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = None, metadata: Optional[dict[str, str]] = None, + output_modalities: Optional[list[Union[str, "_models.SessionModality"]]] = None, + audio: Optional["_models.ResponseCreateAudio"] = None, + tools: Optional[list["_models.FunctionTool"]] = None, + tool_choice: Optional["_unions.VoiceLiveToolChoice"] = None, + pre_generated_assistant_message: Optional["_models.AssistantMessageItem"] = None, interim_response: Optional["_unions.InterimResponseConfig"] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + commit: Optional[bool] = None, + cancel_previous: Optional[bool] = None, + append_input_items: Optional[list["_unions.ConversationRequestItem"]] = None, + input_items: Optional[list["_unions.ConversationRequestItem"]] = None, + temperature: Optional[float] = None, invoke_input: Optional[dict[str, Any]] = None, ) -> None: ... @@ -4247,25 +4490,61 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ResponseFailedDetails(ResponseStatusDetails, discriminator="failed"): - """Details for a failed response. +class ResponseFileSearchCallItem(AzureResponseItem, discriminator="file_search_call"): + """A response item that represents a file search call. - :ivar type: Required. FAILED. - :vartype type: str or ~azure.ai.voicelive.models.FAILED - :ivar error: Required. - :vartype error: any + :ivar id: + :vartype id: str + :ivar object: Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always 'file_search_call'. Required. File search call item. + :vartype type: str or ~azure.ai.voicelive.models.FILE_SEARCH_CALL + :ivar queries: The queries used for the file search. + :vartype queries: list[str] + :ivar status: The status of the file search tool call. Required. Is one of the following types: + Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], + Literal["failed"], str + :vartype status: str or str or str or str or str or str + :ivar results: The results of the file search. + :vartype results: list[~azure.ai.voicelive.models.FileSearchResult] """ - type: Literal[ResponseStatus.FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FAILED.""" - error: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal[ItemType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always 'file_search_call'. Required. File search call item.""" + queries: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The queries used for the file search.""" + status: Union[ + Literal["in_progress"], + Literal["searching"], + Literal["completed"], + Literal["incomplete"], + Literal["failed"], + str, + ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status of the file search tool call. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], + Literal[\"incomplete\"], Literal[\"failed\"], str""" + results: Optional[list["_models.FileSearchResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The results of the file search.""" @overload def __init__( self, *, - error: Any, + status: Union[ + Literal["in_progress"], + Literal["searching"], + Literal["completed"], + Literal["incomplete"], + Literal["failed"], + str, + ], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, + queries: Optional[list[str]] = None, + results: Optional[list["_models.FileSearchResult"]] = None, ) -> None: ... @overload @@ -4277,683 +4556,122 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ResponseStatus.FAILED # type: ignore - + self.type = ItemType.FILE_SEARCH_CALL # type: ignore -class ResponseItem(_Model): - """Base for any response item; discriminated by ``type``. - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ResponseFileSearchCallItem, ResponseFunctionCallItem, ResponseFunctionCallOutputItem, - ResponseMCPApprovalRequestItem, ResponseMCPApprovalResponseItem, ResponseMCPCallItem, - ResponseMCPListToolItem, ResponseMessageItem, ResponseWebSearchCallItem +class ResponseSession(_Model): + """Base for session configuration in the response. - :ivar type: Required. Known values are: "message", "function_call", "function_call_output", - "mcp_list_tools", "mcp_call", "mcp_approval_request", "mcp_approval_response", - "web_search_call", and "file_search_call". - :vartype type: str or ~azure.ai.voicelive.models.ItemType - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"message\", \"function_call\", \"function_call_output\", - \"mcp_list_tools\", \"mcp_call\", \"mcp_approval_request\", \"mcp_approval_response\", - \"web_search_call\", and \"file_search_call\".""" - id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Default value is \"realtime.item\".""" - - @overload - def __init__( - self, - *, - type: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = 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 ResponseFileSearchCallItem(ResponseItem, discriminator="file_search_call"): - """A response item that represents a file search call. - - :ivar id: + :ivar type: The session type. VoiceLive v1 supports realtime sessions only. Required. Default + value is "realtime". + :vartype type: str + :ivar output_modalities: Modalities the service may return. + :vartype output_modalities: list[str or ~azure.ai.voicelive.models.SessionModality] + :ivar instructions: Session instructions. + :vartype instructions: str + :ivar audio: Nested input and output audio configuration. + :vartype audio: ~azure.ai.voicelive.models.AudioConfig + :ivar include: Additional fields to include in server outputs. + :vartype include: list[str] + :ivar tools: Tools available to the model. + :vartype tools: list[~azure.ai.voicelive.models.FunctionTool or + ~azure.ai.voicelive.models.VoiceLiveMcpTool] + :ivar tool_choice: Tool selection behavior. Is one of the following types: Union[str, + "_models.ToolChoiceOptions"], ToolChoiceFunction, ToolChoiceMCP + :vartype tool_choice: str or ~azure.ai.voicelive.models.ToolChoiceOptions or + ~azure.ai.voicelive.models.ToolChoiceFunction or ~azure.ai.voicelive.models.ToolChoiceMCP + :ivar parallel_tool_calls: Whether multiple tool calls may run in parallel. + :vartype parallel_tool_calls: bool + :ivar reasoning: Reasoning configuration for compatible realtime models. + :vartype reasoning: ~azure.ai.voicelive.models.RealtimeReasoning + :ivar max_output_tokens: Maximum output tokens for one response. Is either a int type or a + Literal["inf"] type. + :vartype max_output_tokens: int or str + :ivar animation: The animation configuration for the session. + :vartype animation: ~azure.ai.voicelive.models.Animation + :ivar avatar: Configuration for avatar streaming and behavior during the session. + :vartype avatar: ~azure.ai.voicelive.models.AvatarConfig + :ivar temperature: Controls randomness for compatible cascaded pipelines. Native realtime + pipelines reject this property because the upstream realtime API does not support session + temperature. + :vartype temperature: float + :ivar interim_response: Configuration for interim response generation during latency or tool + 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 voice_adaptation: Voice-optimized instruction adaptation. + :vartype voice_adaptation: ~azure.ai.voicelive.models.VoiceAdaptation + :ivar response_delimiter: Delimiter appended to generated responses. + :vartype response_delimiter: str + :ivar metadata: Set of up to 16 key-value pairs that can be attached to the session. This is + useful for storing additional information about the session in a structured format, such as + tracking IDs, user context, or application-specific labels. These key-value pairs are also + included in Foundry resource logs for tracing and diagnostics. Keys can be a maximum of 64 + characters long and values can be a maximum of 512 characters long. + :vartype metadata: dict[str, str] + :ivar agent: The agent configuration for the session, if applicable. + :vartype agent: ~azure.ai.voicelive.models.AgentConfig + :ivar id: The unique identifier for the session. Required. :vartype id: str - :ivar object: Default value is "realtime.item". + :ivar object: The response object type. Required. Default value is "realtime.session". :vartype object: str - :ivar type: The type of the item. Always 'file_search_call'. Required. File search call item. - :vartype type: str or ~azure.ai.voicelive.models.FILE_SEARCH_CALL - :ivar queries: The queries used for the file search. - :vartype queries: list[str] - :ivar status: The status of the file search tool call. Required. Is one of the following types: - Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["incomplete"], - Literal["failed"], str - :vartype status: str or str or str or str or str or str - :ivar results: The results of the file search. - :vartype results: list[~azure.ai.voicelive.models.FileSearchResult] + :ivar model: The selected model. Required. + :vartype model: 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 """ - type: Literal[ItemType.FILE_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always 'file_search_call'. Required. File search call item.""" - queries: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The queries used for the file search.""" - status: Union[ - Literal["in_progress"], - Literal["searching"], - Literal["completed"], - Literal["incomplete"], - Literal["failed"], - str, - ] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The status of the file search tool call. Required. Is one of the following types: - Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], - Literal[\"incomplete\"], Literal[\"failed\"], str""" - results: Optional[list["_models.FileSearchResult"]] = rest_field( + type: Literal["realtime"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The session type. VoiceLive v1 supports realtime sessions only. Required. Default value is + \"realtime\".""" + output_modalities: Optional[list[Union[str, "_models.SessionModality"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The results of the file search.""" - - @overload - def __init__( - self, - *, - status: Union[ - Literal["in_progress"], - Literal["searching"], - Literal["completed"], - Literal["incomplete"], - Literal["failed"], - str, - ], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - queries: Optional[list[str]] = None, - results: Optional[list["_models.FileSearchResult"]] = 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 = ItemType.FILE_SEARCH_CALL # type: ignore - - -class ResponseFunctionCallItem(ResponseItem, discriminator="function_call"): - """A function call item within a conversation. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: Required. FUNCTION_CALL. - :vartype type: str or ~azure.ai.voicelive.models.FUNCTION_CALL - :ivar name: Required. - :vartype name: str - :ivar call_id: Required. - :vartype call_id: str - :ivar arguments: Required. - :vartype arguments: str - :ivar status: Required. Known values are: "in_progress", "completed", and "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ResponseItemStatus - """ - - type: Literal[ItemType.FUNCTION_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FUNCTION_CALL.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - status: Union[str, "_models.ResponseItemStatus"] = rest_field( + """Modalities the service may return.""" + instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Session instructions.""" + audio: Optional["_models.AudioConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Nested input and output audio configuration.""" + include: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Additional fields to include in server outputs.""" + tools: Optional[list["_unions.VoiceLiveTool"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" - - @overload - def __init__( - self, - *, - name: str, - call_id: str, - arguments: str, - status: Union[str, "_models.ResponseItemStatus"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = 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 = ItemType.FUNCTION_CALL # type: ignore - - -class ResponseFunctionCallOutputItem(ResponseItem, discriminator="function_call_output"): - """A function call output item within a conversation. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: Required. FUNCTION_CALL_OUTPUT. - :vartype type: str or ~azure.ai.voicelive.models.FUNCTION_CALL_OUTPUT - :ivar call_id: Required. - :vartype call_id: str - :ivar output: Required. - :vartype output: str - """ - - type: Literal[ItemType.FUNCTION_CALL_OUTPUT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FUNCTION_CALL_OUTPUT.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - call_id: str, - output: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = 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 = ItemType.FUNCTION_CALL_OUTPUT # type: ignore - - -class ResponseIncompleteDetails(ResponseStatusDetails, discriminator="incomplete"): - """Details for an incomplete response. - - :ivar type: Required. INCOMPLETE. - :vartype type: str or ~azure.ai.voicelive.models.INCOMPLETE - :ivar reason: Required. Is one of the following types: Literal["max_output_tokens"], - Literal["content_filter"], str - :vartype reason: str or str or str - """ - - type: Literal[ResponseStatus.INCOMPLETE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. INCOMPLETE.""" - reason: Union[Literal["max_output_tokens"], Literal["content_filter"], str] = rest_field( + """Tools available to the model.""" + tool_choice: Optional["_unions.VoiceLiveToolChoice"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Is one of the following types: Literal[\"max_output_tokens\"], - Literal[\"content_filter\"], str""" - - @overload - def __init__( - self, - *, - reason: Union[Literal["max_output_tokens"], Literal["content_filter"], str], - ) -> 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 = ResponseStatus.INCOMPLETE # type: ignore - - -class ResponseMCPApprovalRequestItem(ResponseItem, discriminator="mcp_approval_request"): - """A response item that represents a request for approval to call an MCP tool. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Required. MCP_APPROVAL_REQUEST. - :vartype type: str or ~azure.ai.voicelive.models.MCP_APPROVAL_REQUEST - :ivar arguments: The arguments for the tool call. - :vartype arguments: str - :ivar name: The name of the tool to call. Required. - :vartype name: str - :ivar server_label: The label of the server that provides the tool. Required. - :vartype server_label: str - """ - - type: Literal[ItemType.MCP_APPROVAL_REQUEST] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Required. MCP_APPROVAL_REQUEST.""" - arguments: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments for the tool call.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool to call. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the server that provides the tool. Required.""" - - @overload - def __init__( - self, - *, - name: str, - server_label: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - arguments: 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 = ItemType.MCP_APPROVAL_REQUEST # type: ignore - - -class ResponseMCPApprovalResponseItem(ResponseItem, discriminator="mcp_approval_response"): - """A response item that represents a response to an MCP approval request. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Required. MCP_APPROVAL_RESPONSE. - :vartype type: str or ~azure.ai.voicelive.models.MCP_APPROVAL_RESPONSE - :ivar approval_request_id: The ID of the approval request. Required. - :vartype approval_request_id: str - :ivar approve: Whether the tool call was approved. Required. - :vartype approve: bool - :ivar reason: The reason for the approval decision. - :vartype reason: str - """ - - type: Literal[ItemType.MCP_APPROVAL_RESPONSE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Required. MCP_APPROVAL_RESPONSE.""" - approval_request_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request. Required.""" - approve: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether the tool call was approved. Required.""" - reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The reason for the approval decision.""" - - @overload - def __init__( - self, - *, - approval_request_id: str, - approve: bool, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - reason: 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 = ItemType.MCP_APPROVAL_RESPONSE # type: ignore - - -class ResponseMCPCallItem(ResponseItem, discriminator="mcp_call"): - """A response item that represents a call to an MCP tool. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Required. MCP_CALL. - :vartype type: str or ~azure.ai.voicelive.models.MCP_CALL - :ivar approval_request_id: The ID of the approval request, if any. - :vartype approval_request_id: str - :ivar arguments: The arguments for the tool call. Required. - :vartype arguments: str - :ivar server_label: The label of the server that provides the tool. Required. - :vartype server_label: str - :ivar name: The name of the tool to call. Required. - :vartype name: str - :ivar output: The output of the tool call. - :vartype output: str - :ivar error: The error, if any, from the tool call. - :vartype error: any - """ - - type: Literal[ItemType.MCP_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Required. MCP_CALL.""" - approval_request_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the approval request, if any.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments for the tool call. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the server that provides the tool. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the tool to call. Required.""" - output: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The output of the tool call.""" - error: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The error, if any, from the tool call.""" - - @overload - def __init__( - self, - *, - arguments: str, - server_label: str, - name: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = None, - approval_request_id: Optional[str] = None, - output: Optional[str] = None, - error: Optional[Any] = 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 = ItemType.MCP_CALL # type: ignore - - -class ResponseMCPListToolItem(ResponseItem, discriminator="mcp_list_tools"): - """A response item that lists the tools available on an MCP server. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Required. MCP_LIST_TOOLS. - :vartype type: str or ~azure.ai.voicelive.models.MCP_LIST_TOOLS - :ivar tools: The tools available on the server. Required. - :vartype tools: list[~azure.ai.voicelive.models.MCPTool] - :ivar server_label: The label of the server that provides the tools. Required. - :vartype server_label: str - """ - - type: Literal[ItemType.MCP_LIST_TOOLS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Required. MCP_LIST_TOOLS.""" - tools: list["_models.MCPTool"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The tools available on the server. Required.""" - server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The label of the server that provides the tools. Required.""" - - @overload - def __init__( - self, - *, - tools: list["_models.MCPTool"], - server_label: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = 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 = ItemType.MCP_LIST_TOOLS # type: ignore - - -class ResponseMessageItem(ResponseItem, discriminator="message"): - """Base type for message item within a conversation. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: Required. MESSAGE. - :vartype type: str or ~azure.ai.voicelive.models.MESSAGE - :ivar role: Required. Known values are: "system", "user", and "assistant". - :vartype role: str or ~azure.ai.voicelive.models.MessageRole - :ivar content: Required. - :vartype content: list[~azure.ai.voicelive.models.ContentPart] - :ivar status: Required. Known values are: "in_progress", "completed", and "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ResponseItemStatus - """ - - type: Literal[ItemType.MESSAGE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MESSAGE.""" - role: Union[str, "_models.MessageRole"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"system\", \"user\", and \"assistant\".""" - content: list["_models.ContentPart"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - status: Union[str, "_models.ResponseItemStatus"] = rest_field( + """Tool selection behavior. Is one of the following types: Union[str, + \"_models.ToolChoiceOptions\"], ToolChoiceFunction, ToolChoiceMCP""" + parallel_tool_calls: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether multiple tool calls may run in parallel.""" + reasoning: Optional["_models.RealtimeReasoning"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """Required. Known values are: \"in_progress\", \"completed\", and \"incomplete\".""" - - @overload - def __init__( - self, - *, - role: Union[str, "_models.MessageRole"], - content: list["_models.ContentPart"], - status: Union[str, "_models.ResponseItemStatus"], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = 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 = ItemType.MESSAGE # type: ignore - - -class ResponseSession(_Model): - """Base for session configuration in the response. - - :ivar model: The model for the session. - :vartype model: str - :ivar modalities: The modalities to be used in the session. - :vartype modalities: list[str or ~azure.ai.voicelive.models.Modality] - :ivar animation: The animation configuration for the session. - :vartype animation: ~azure.ai.voicelive.models.Animation - :ivar voice: The voice configuration for the session. Is one of the following types: Union[str, - "_models.OpenAIVoiceName"], OpenAIVoice, AzureVoice, AzureRealtimeNativeVoice - :vartype voice: str or ~azure.ai.voicelive.models.OpenAIVoiceName or - ~azure.ai.voicelive.models.OpenAIVoice or ~azure.ai.voicelive.models.AzureVoice or - ~azure.ai.voicelive.models.AzureRealtimeNativeVoice - :ivar instructions: Optional instructions to guide the model's behavior throughout the session. - :vartype instructions: str - :ivar input_audio_sampling_rate: Input audio sampling rate in Hz. Available values: - - * For pcm16: 8000, 16000, 24000 - - * For g711_alaw/g711_ulaw: 8000. - :vartype input_audio_sampling_rate: int - :ivar input_audio_format: Input audio format. Default is 'pcm16'. Known values are: "pcm16", - "g711_ulaw", and "g711_alaw". - :vartype input_audio_format: str or ~azure.ai.voicelive.models.InputAudioFormat - :ivar output_audio_format: Output audio format. Default is 'pcm16'. Known values are: "pcm16", - "pcm16_8000hz", "pcm16_16000hz", "g711_ulaw", and "g711_alaw". - :vartype output_audio_format: str or ~azure.ai.voicelive.models.OutputAudioFormat - :ivar turn_detection: Type of turn detection to use. - :vartype turn_detection: ~azure.ai.voicelive.models.TurnDetection - :ivar input_audio_noise_reduction: Configuration for input audio noise reduction. - :vartype input_audio_noise_reduction: ~azure.ai.voicelive.models.AudioNoiseReduction - :ivar input_audio_echo_cancellation: Configuration for echo cancellation during server-side - audio processing. - :vartype input_audio_echo_cancellation: ~azure.ai.voicelive.models.AudioEchoCancellation - :ivar avatar: Configuration for avatar streaming and behavior during the session. - :vartype avatar: ~azure.ai.voicelive.models.AvatarConfig - :ivar input_audio_transcription: Configuration for input audio transcription. - :vartype input_audio_transcription: ~azure.ai.voicelive.models.AudioInputTranscriptionOptions - :ivar output_audio_timestamp_types: Types of timestamps to include in audio response content. - :vartype output_audio_timestamp_types: list[str or - ~azure.ai.voicelive.models.AudioTimestampType] - :ivar tools: Configuration for tools to be used during the session, if applicable. - :vartype tools: list[~azure.ai.voicelive.models.Tool] - :ivar tool_choice: Specifies which tools the model is allowed to call during the session. Is - either a Union[str, "_models.ToolChoiceLiteral"] type or a ToolChoiceSelection type. - :vartype tool_choice: str or ~azure.ai.voicelive.models.ToolChoiceLiteral or - ~azure.ai.voicelive.models.ToolChoiceSelection - :ivar parallel_tool_calls: Whether the model is allowed to call tools in parallel. - :vartype parallel_tool_calls: bool - :ivar temperature: Controls the randomness of the model's output. Range: 0.0 to 1.0. Default is - 0.7. - :vartype temperature: float - :ivar max_response_output_tokens: Maximum number of tokens to generate in the response. Default - is unlimited. Is either a int type or a Literal["inf"] type. - :vartype max_response_output_tokens: int or str - :ivar reasoning_effort: Constrains effort on reasoning for reasoning models. Check model - documentation for supported 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". - :vartype reasoning_effort: str or ~azure.ai.voicelive.models.ReasoningEffort - :ivar interim_response: Configuration for interim response generation during latency or tool - 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 include: List of include options for the session (e.g., logprobs, phrases, file search - results). - :vartype include: list[str or ~azure.ai.voicelive.models.SessionIncludeOption] - :ivar metadata: Set of up to 16 key-value pairs that can be attached to the session. This is - useful for storing additional information about the session in a structured format, such as - tracking IDs, user context, or application-specific labels. These key-value pairs are also - included in Foundry resource logs for tracing and diagnostics. Keys can be a maximum of 64 - characters long and values can be a maximum of 512 characters long. - :vartype metadata: dict[str, str] - :ivar agent: The agent configuration for the session, if applicable. - :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"]) - """The model for the session.""" - modalities: Optional[list[Union[str, "_models.Modality"]]] = rest_field( + """Reasoning configuration for compatible realtime models.""" + max_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The modalities to be used in the session.""" + """Maximum output tokens for one response. Is either a int type or a Literal[\"inf\"] type.""" animation: Optional["_models.Animation"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The animation configuration for the session.""" - 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"]) - """Optional instructions to guide the model's behavior throughout the session.""" - input_audio_sampling_rate: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Input audio sampling rate in Hz. Available values: - - * For pcm16: 8000, 16000, 24000 - - * For g711_alaw/g711_ulaw: 8000.""" - input_audio_format: Optional[Union[str, "_models.InputAudioFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Input audio format. Default is 'pcm16'. Known values are: \"pcm16\", \"g711_ulaw\", and - \"g711_alaw\".""" - output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Output audio format. Default is 'pcm16'. Known values are: \"pcm16\", \"pcm16_8000hz\", - \"pcm16_16000hz\", \"g711_ulaw\", and \"g711_alaw\".""" - turn_detection: Optional["_models.TurnDetection"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Type of turn detection to use.""" - input_audio_noise_reduction: Optional["_models.AudioNoiseReduction"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for input audio noise reduction.""" - input_audio_echo_cancellation: Optional["_models.AudioEchoCancellation"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for echo cancellation during server-side audio processing.""" avatar: Optional["_models.AvatarConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Configuration for avatar streaming and behavior during the session.""" - input_audio_transcription: Optional["_models.AudioInputTranscriptionOptions"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for input audio transcription.""" - output_audio_timestamp_types: Optional[list[Union[str, "_models.AudioTimestampType"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """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["_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"]) - """Whether the model is allowed to call tools in parallel.""" temperature: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Controls the randomness of the model's output. Range: 0.0 to 1.0. Default is 0.7.""" - max_response_output_tokens: Optional[Union[int, Literal["inf"]]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Maximum number of tokens to generate in the response. Default is unlimited. Is either a int - type or a Literal[\"inf\"] type.""" - reasoning_effort: Optional[Union[str, "_models.ReasoningEffort"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Constrains effort on reasoning for reasoning models. Check model documentation for supported - 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\".""" + """Controls randomness for compatible cascaded pipelines. Native realtime pipelines reject this + property because the upstream realtime API does not support session temperature.""" 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.""" - include: Optional[list[Union[str, "_models.SessionIncludeOption"]]] = rest_field( + voice_adaptation: Optional["_models.VoiceAdaptation"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """List of include options for the session (e.g., logprobs, phrases, file search results).""" + """Voice-optimized instruction adaptation.""" + response_delimiter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Delimiter appended to generated responses.""" metadata: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Set of up to 16 key-value pairs that can be attached to the session. This is useful for storing additional information about the session in a structured format, such as tracking IDs, user @@ -4962,1826 +4680,42 @@ class ResponseSession(_Model): values can be a maximum of 512 characters long.""" agent: Optional["_models.AgentConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """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.""" + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique identifier for the session. Required.""" + object: Literal["realtime.session"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The response object type. Required. Default value is \"realtime.session\".""" + model: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The selected model. Required.""" 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 - self, - *, - model: Optional[str] = None, - modalities: Optional[list[Union[str, "_models.Modality"]]] = None, - animation: Optional["_models.Animation"] = 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, - output_audio_format: Optional[Union[str, "_models.OutputAudioFormat"]] = None, - turn_detection: Optional["_models.TurnDetection"] = None, - input_audio_noise_reduction: Optional["_models.AudioNoiseReduction"] = None, - input_audio_echo_cancellation: Optional["_models.AudioEchoCancellation"] = None, - avatar: Optional["_models.AvatarConfig"] = None, - 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["_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["_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 - 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 ResponseTextContentPart(ContentPart, discriminator="text"): - """A text content part for a response. - - :ivar type: Required. TEXT. - :vartype type: str or ~azure.ai.voicelive.models.TEXT - :ivar text: - :vartype text: str - """ - - type: Literal[ContentPartType.TEXT] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. TEXT.""" - text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - text: 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 = ContentPartType.TEXT # type: ignore - - -class ResponseWebSearchCallItem(ResponseItem, discriminator="web_search_call"): - """A response item that represents a web search call. - - :ivar id: - :vartype id: str - :ivar object: Default value is "realtime.item". - :vartype object: str - :ivar type: The type of the item. Always 'web_search_call'. Required. Web search call item. - :vartype type: str or ~azure.ai.voicelive.models.WEB_SEARCH_CALL - :ivar status: The status of the web search tool call. Required. Is one of the following types: - Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str - :vartype status: str or str or str or str or str - """ - - type: Literal[ItemType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The type of the item. Always 'web_search_call'. Required. Web search call item.""" - status: Union[Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str] = ( - rest_field(visibility=["read", "create", "update", "delete", "query"]) - ) - """The status of the web search tool call. Required. Is one of the following types: - Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], Literal[\"failed\"], - str""" - - @overload - def __init__( - self, - *, - status: Union[Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str], - id: Optional[str] = None, # pylint: disable=redefined-builtin - object: Optional[Literal["realtime.item"]] = 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 = ItemType.WEB_SEARCH_CALL # type: ignore - - -class Scene(_Model): - """Configuration for avatar's zoom level, position, rotation and movement amplitude in the video - frame. - - :ivar zoom: Zoom level of the avatar. Range is (0, +∞). Values less than 1 zoom out, values - greater than 1 zoom in. - :vartype zoom: float - :ivar position_x: Horizontal position of the avatar. Range is [-1, 1], as a proportion of frame - width. Negative values move left, positive values move right. - :vartype position_x: float - :ivar position_y: Vertical position of the avatar. Range is [-1, 1], as a proportion of frame - height. Negative values move up, positive values move down. - :vartype position_y: float - :ivar rotation_x: Rotation around the X-axis (pitch). Range is [-π, π] in radians. Negative - values rotate up, positive values rotate down. - :vartype rotation_x: float - :ivar rotation_y: Rotation around the Y-axis (yaw). Range is [-π, π] in radians. Negative - values rotate left, positive values rotate right. - :vartype rotation_y: float - :ivar rotation_z: Rotation around the Z-axis (roll). Range is [-π, π] in radians. Negative - values rotate anticlockwise, positive values rotate clockwise. - :vartype rotation_z: float - :ivar amplitude: Amplitude of the avatar movement. Range is (0, 1]. Values in (0, 1) mean - reduced amplitude, 1 means full amplitude. - :vartype amplitude: float - """ - - zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Zoom level of the avatar. Range is (0, +∞). Values less than 1 zoom out, values greater than 1 - zoom in.""" - position_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Horizontal position of the avatar. Range is [-1, 1], as a proportion of frame width. Negative - values move left, positive values move right.""" - position_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Vertical position of the avatar. Range is [-1, 1], as a proportion of frame height. Negative - values move up, positive values move down.""" - rotation_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Rotation around the X-axis (pitch). Range is [-π, π] in radians. Negative values rotate up, - positive values rotate down.""" - rotation_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Rotation around the Y-axis (yaw). Range is [-π, π] in radians. Negative values rotate left, - positive values rotate right.""" - rotation_z: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Rotation around the Z-axis (roll). Range is [-π, π] in radians. Negative values rotate - anticlockwise, positive values rotate clockwise.""" - amplitude: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Amplitude of the avatar movement. Range is (0, 1]. Values in (0, 1) mean reduced amplitude, 1 - means full amplitude.""" - - @overload - def __init__( - self, - *, - zoom: Optional[float] = None, - position_x: Optional[float] = None, - position_y: Optional[float] = None, - rotation_x: Optional[float] = None, - rotation_y: Optional[float] = None, - rotation_z: Optional[float] = None, - amplitude: Optional[float] = 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 ServerEvent(_Model): - """A voicelive server event. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ServerEventConversationItemCreated, ServerEventConversationItemDeleted, - ServerEventConversationItemInputAudioTranscriptionCompleted, - ServerEventConversationItemInputAudioTranscriptionDelta, - ServerEventConversationItemInputAudioTranscriptionFailed, ServerEventConversationItemRetrieved, - ServerEventConversationItemTruncated, ServerEventError, ServerEventInputAudioBufferCleared, - ServerEventInputAudioBufferCommitted, ServerEventInputAudioBufferSpeechStarted, - ServerEventInputAudioBufferSpeechStopped, ServerEventMcpListToolsCompleted, - ServerEventMcpListToolsFailed, ServerEventMcpListToolsInProgress, - ServerEventOutputAudioBufferCleared, ServerEventResponseAnimationBlendshapeDelta, - ServerEventResponseAnimationBlendshapeDone, ServerEventResponseAnimationVisemeDelta, - ServerEventResponseAnimationVisemeDone, ServerEventResponseAudioDelta, - ServerEventResponseAudioDone, ServerEventResponseAudioTimestampDelta, - ServerEventResponseAudioTimestampDone, ServerEventResponseAudioTranscriptAnnotationAdded, - ServerEventResponseAudioTranscriptDelta, ServerEventResponseAudioTranscriptDone, - ServerEventResponseContentPartAdded, ServerEventResponseContentPartDone, - ServerEventResponseCreated, ServerEventResponseDone, - ServerEventResponseFileSearchCallCompleted, ServerEventResponseFileSearchCallInProgress, - ServerEventResponseFileSearchCallSearching, ServerEventResponseFunctionCallArgumentsDelta, - ServerEventResponseFunctionCallArgumentsDone, ServerEventResponseInvocationDelta, - ServerEventResponseMcpCallCompleted, ServerEventResponseMcpCallFailed, - ServerEventResponseMcpCallInProgress, ServerEventResponseMcpCallArgumentsDelta, - ServerEventResponseMcpCallArgumentsDone, ServerEventResponseOutputItemAdded, - ServerEventResponseOutputItemDone, ServerEventResponseTextDelta, ServerEventResponseTextDone, - ServerEventResponseVideoDelta, ServerEventResponseWebSearchCallCompleted, - ServerEventResponseWebSearchCallInProgress, ServerEventResponseWebSearchCallSearching, - 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", - "conversation.item.input_audio_transcription.completed", - "conversation.item.input_audio_transcription.delta", - "conversation.item.input_audio_transcription.failed", "conversation.item.created", - "conversation.item.retrieved", "conversation.item.truncated", "conversation.item.deleted", - "input_audio_buffer.committed", "input_audio_buffer.cleared", - "input_audio_buffer.speech_started", "input_audio_buffer.speech_stopped", "response.created", - "response.done", "response.output_item.added", "response.output_item.done", - "response.content_part.added", "response.content_part.done", "response.text.delta", - "response.text.done", "response.audio_transcript.delta", "response.audio_transcript.done", - "response.audio.delta", "response.audio.done", "response.animation_blendshapes.delta", - "response.animation_blendshapes.done", "response.audio_timestamp.delta", - "response.audio_timestamp.done", "response.animation_viseme.delta", - "response.animation_viseme.done", "response.function_call_arguments.delta", - "response.function_call_arguments.done", "mcp_list_tools.in_progress", - "mcp_list_tools.completed", "mcp_list_tools.failed", "response.mcp_call_arguments.delta", - "response.mcp_call_arguments.done", "response.mcp_call.in_progress", - "response.mcp_call.completed", "response.mcp_call.failed", "session.avatar.switch_to_speaking", - "session.avatar.switch_to_idle", "response.video.delta", "response.web_search_call.searching", - "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", and "response.invocation.delta". - :vartype type: str or ~azure.ai.voicelive.models.ServerEventType - :ivar event_id: - :vartype event_id: str - """ - - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """The type of event. Required. Known values are: \"error\", \"warning\", - \"session.avatar.connecting\", \"session.created\", \"session.updated\", - \"conversation.item.input_audio_transcription.completed\", - \"conversation.item.input_audio_transcription.delta\", - \"conversation.item.input_audio_transcription.failed\", \"conversation.item.created\", - \"conversation.item.retrieved\", \"conversation.item.truncated\", - \"conversation.item.deleted\", \"input_audio_buffer.committed\", - \"input_audio_buffer.cleared\", \"input_audio_buffer.speech_started\", - \"input_audio_buffer.speech_stopped\", \"response.created\", \"response.done\", - \"response.output_item.added\", \"response.output_item.done\", \"response.content_part.added\", - \"response.content_part.done\", \"response.text.delta\", \"response.text.done\", - \"response.audio_transcript.delta\", \"response.audio_transcript.done\", - \"response.audio.delta\", \"response.audio.done\", \"response.animation_blendshapes.delta\", - \"response.animation_blendshapes.done\", \"response.audio_timestamp.delta\", - \"response.audio_timestamp.done\", \"response.animation_viseme.delta\", - \"response.animation_viseme.done\", \"response.function_call_arguments.delta\", - \"response.function_call_arguments.done\", \"mcp_list_tools.in_progress\", - \"mcp_list_tools.completed\", \"mcp_list_tools.failed\", \"response.mcp_call_arguments.delta\", - \"response.mcp_call_arguments.done\", \"response.mcp_call.in_progress\", - \"response.mcp_call.completed\", \"response.mcp_call.failed\", - \"session.avatar.switch_to_speaking\", \"session.avatar.switch_to_idle\", - \"response.video.delta\", \"response.web_search_call.searching\", - \"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\", and \"response.invocation.delta\".""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - type: 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) - - -class ServerEventConversationItemCreated(ServerEvent, discriminator="conversation.item.created"): - """Returned when a conversation item is created. There are several scenarios that produce this - event: - - * The server is generating a Response, which if successful will produce - either one or two Items, which will be of type `message` - (role `assistant`) or type `function_call`. - * The input audio buffer has been committed, either by the client or the - server (in `server_vad` mode). The server will take the content of the - input audio buffer and add it to a new user message Item. - * The client has sent a `conversation.item.create` event to add a new Item - to the Conversation. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.created``. Required. - CONVERSATION_ITEM_CREATED. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_CREATED - :ivar previous_item_id: The ID of the preceding item in the Conversation context, allows the - client to understand the order of the conversation. - :vartype previous_item_id: str - :ivar item: - :vartype item: ~azure.ai.voicelive.models.ResponseItem - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.created``. Required. CONVERSATION_ITEM_CREATED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the preceding item in the Conversation context, allows the client to understand the - order of the conversation.""" - item: Optional["_models.ResponseItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - event_id: Optional[str] = None, - previous_item_id: Optional[str] = None, - item: Optional["_models.ResponseItem"] = 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.CONVERSATION_ITEM_CREATED # type: ignore - - -class ServerEventConversationItemDeleted(ServerEvent, discriminator="conversation.item.deleted"): - """Returned when an item in the conversation is deleted by the client with a - ``conversation.item.delete`` event. This event is used to synchronize the server's - understanding of the conversation history with the client's view. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.deleted``. Required. - CONVERSATION_ITEM_DELETED. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_DELETED - :ivar item_id: The ID of the item that was deleted. Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_DELETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.deleted``. Required. CONVERSATION_ITEM_DELETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item that was deleted. Required.""" - - @overload - def __init__( - self, - *, - item_id: 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.CONVERSATION_ITEM_DELETED # type: ignore - - -class ServerEventConversationItemInputAudioTranscriptionCompleted( - ServerEvent, discriminator="conversation.item.input_audio_transcription.completed" -): # pylint: disable=name-too-long - """This event is the output of audio transcription for user audio written to the user audio - buffer. Transcription begins when the input audio buffer is committed by the client or server - (in ``server_vad`` mode). Transcription runs asynchronously with Response creation, so this - event may come before or after the Response events. VoiceLive API models accept audio natively, - and thus input transcription is a separate process run on a separate ASR (Automatic Speech - Recognition) model. The transcript may diverge somewhat from the model's interpretation, and - should be treated as a rough guide. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.completed``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED. - :vartype type: str or - ~azure.ai.voicelive.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED - :ivar item_id: The ID of the user message item containing the audio. Required. - :vartype item_id: str - :ivar content_index: The index of the content part containing the audio. Required. - :vartype content_index: int - :ivar transcript: The transcribed text. Required. - :vartype transcript: str - :ivar logprobs: The log probabilities of the transcription tokens. - :vartype logprobs: list[~azure.ai.voicelive.models.LogProbProperties] - :ivar phrases: The transcription phrases with timing information. - :vartype phrases: list[~azure.ai.voicelive.models.TranscriptionPhrase] - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.completed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item containing the audio. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part containing the audio. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcribed text. Required.""" - logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The log probabilities of the transcription tokens.""" - phrases: Optional[list["_models.TranscriptionPhrase"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The transcription phrases with timing information.""" - - @overload - def __init__( - self, - *, - item_id: str, - content_index: int, - transcript: str, - event_id: Optional[str] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = None, - phrases: Optional[list["_models.TranscriptionPhrase"]] = 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED # type: ignore - - -class ServerEventConversationItemInputAudioTranscriptionDelta( - ServerEvent, discriminator="conversation.item.input_audio_transcription.delta" -): # pylint: disable=name-too-long - """Returned when the text value of an input audio transcription content part is updated. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.delta``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA. - :vartype type: str or - ~azure.ai.voicelive.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar content_index: The index of the content part in the item's content array. - :vartype content_index: int - :ivar delta: The text delta. - :vartype delta: str - :ivar logprobs: The log probabilities of the transcription. - :vartype logprobs: list[~azure.ai.voicelive.models.LogProbProperties] - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.delta``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - content_index: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array.""" - delta: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta.""" - logprobs: Optional[list["_models.LogProbProperties"]] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The log probabilities of the transcription.""" - - @overload - def __init__( - self, - *, - item_id: str, - event_id: Optional[str] = None, - content_index: Optional[int] = None, - delta: Optional[str] = None, - logprobs: Optional[list["_models.LogProbProperties"]] = 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTA # type: ignore - - -class ServerEventConversationItemInputAudioTranscriptionFailed( - ServerEvent, discriminator="conversation.item.input_audio_transcription.failed" -): # pylint: disable=name-too-long - """Returned when input audio transcription is configured, and a transcription request for a user - message failed. These events are separate from other ``error`` events so that the client can - identify the related Item. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.input_audio_transcription.failed``. - Required. CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED. - :vartype type: str or - ~azure.ai.voicelive.models.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED - :ivar item_id: The ID of the user message item. Required. - :vartype item_id: str - :ivar content_index: The index of the content part containing the audio. Required. - :vartype content_index: int - :ivar error: Details of the transcription error. Required. - :vartype error: ~azure.ai.voicelive.models.VoiceLiveErrorDetails - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.input_audio_transcription.failed``. Required. - CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part containing the audio. Required.""" - error: "_models.VoiceLiveErrorDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Details of the transcription error. Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - content_index: int, - error: "_models.VoiceLiveErrorDetails", - 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.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_FAILED # type: ignore - - -class ServerEventConversationItemRetrieved(ServerEvent, discriminator="conversation.item.retrieved"): - """Returned when a conversation item is retrieved with ``conversation.item.retrieve``. - - :ivar type: The event type, must be ``conversation.item.retrieved``. Required. - CONVERSATION_ITEM_RETRIEVED. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_RETRIEVED - :ivar item: - :vartype item: ~azure.ai.voicelive.models.ResponseItem - :ivar event_id: - :vartype event_id: str - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_RETRIEVED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.retrieved``. Required. CONVERSATION_ITEM_RETRIEVED.""" - item: Optional["_models.ResponseItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - item: Optional["_models.ResponseItem"] = None, - 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.CONVERSATION_ITEM_RETRIEVED # type: ignore - - -class ServerEventConversationItemTruncated(ServerEvent, discriminator="conversation.item.truncated"): - """Returned when an earlier assistant audio message item is truncated by the client with a - ``conversation.item.truncate`` event. This event is used to synchronize the server's - understanding of the audio with the client's playback. This action will truncate the audio and - remove the server-side text transcript to ensure there is no text in the context that hasn't - been heard by the user. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``conversation.item.truncated``. Required. - CONVERSATION_ITEM_TRUNCATED. - :vartype type: str or ~azure.ai.voicelive.models.CONVERSATION_ITEM_TRUNCATED - :ivar item_id: The ID of the assistant message item that was truncated. Required. - :vartype item_id: str - :ivar content_index: The index of the content part that was truncated. Required. - :vartype content_index: int - :ivar audio_end_ms: The duration up to which the audio was truncated, in milliseconds. - Required. - :vartype audio_end_ms: int - """ - - type: Literal[ServerEventType.CONVERSATION_ITEM_TRUNCATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``conversation.item.truncated``. Required. CONVERSATION_ITEM_TRUNCATED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the assistant message item that was truncated. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part that was truncated. Required.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The duration up to which the audio was truncated, in milliseconds. Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - content_index: int, - audio_end_ms: int, - 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.CONVERSATION_ITEM_TRUNCATED # type: ignore - - -class ServerEventError(ServerEvent, discriminator="error"): - """Returned when an error occurs, which could be a client problem or a server problem. Most errors - are recoverable and the session will stay open, we recommend to implementors to monitor and log - error messages by default. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``error``. Required. ERROR. - :vartype type: str or ~azure.ai.voicelive.models.ERROR - :ivar error: Details of the error. Required. - :vartype error: ~azure.ai.voicelive.models.ServerEventErrorDetails - """ - - type: Literal[ServerEventType.ERROR] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``error``. Required. ERROR.""" - error: "_models.ServerEventErrorDetails" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Details of the error. Required.""" - - @overload - def __init__( - self, - *, - error: "_models.ServerEventErrorDetails", - 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.ERROR # type: ignore - - -class ServerEventErrorDetails(_Model): - """Details of the error. - - :ivar type: The type of error (e.g., "invalid_request_error", "server_error"). Required. - :vartype type: str - :ivar code: Error code, if any. - :vartype code: str - :ivar message: A human-readable error message. Required. - :vartype message: str - :ivar param: Parameter related to the error, if any. - :vartype param: str - :ivar event_id: The event_id of the client event that caused the error, if applicable. - :vartype event_id: str - """ - - type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The type of error (e.g., \"invalid_request_error\", \"server_error\"). Required.""" - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error code, if any.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """A human-readable error message. Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Parameter related to the error, if any.""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The event_id of the client event that caused the error, if applicable.""" - - @overload - def __init__( - self, - *, - type: str, - message: str, - code: Optional[str] = None, - param: Optional[str] = None, - 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) - - -class ServerEventInputAudioBufferCleared(ServerEvent, discriminator="input_audio_buffer.cleared"): - """Returned when the input audio buffer is cleared by the client with a - ``input_audio_buffer.clear`` event. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.cleared``. Required. - INPUT_AUDIO_BUFFER_CLEARED. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_CLEARED - """ - - type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.cleared``. Required. INPUT_AUDIO_BUFFER_CLEARED.""" - - @overload - def __init__( - self, - *, - 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.INPUT_AUDIO_BUFFER_CLEARED # type: ignore - - -class ServerEventInputAudioBufferCommitted(ServerEvent, discriminator="input_audio_buffer.committed"): - """Returned when an input audio buffer is committed, either by the client or automatically in - server VAD mode. The ``item_id`` property is the ID of the user message item that will be - created, thus a ``conversation.item.created`` event will also be sent to the client. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_COMMITTED - :ivar previous_item_id: The ID of the preceding item after which the new item will be inserted. - :vartype previous_item_id: str - :ivar item_id: The ID of the user message item that will be created. Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_COMMITTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.committed``. Required. - INPUT_AUDIO_BUFFER_COMMITTED.""" - previous_item_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the preceding item after which the new item will be inserted.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created. Required.""" - - @overload - def __init__( - self, - *, - item_id: str, - event_id: Optional[str] = None, - previous_item_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.INPUT_AUDIO_BUFFER_COMMITTED # type: ignore - - -class ServerEventInputAudioBufferSpeechStarted(ServerEvent, discriminator="input_audio_buffer.speech_started"): - """Sent by the server when in ``server_vad`` mode to indicate that speech has been detected in the - audio buffer. This can happen any time audio is added to the buffer (unless speech is already - detected). The client may want to use this event to interrupt audio playback or provide visual - feedback to the user. The client should expect to receive a - ``input_audio_buffer.speech_stopped`` event when speech stops. The ``item_id`` property is the - ID of the user message item that will be created when speech stops and will also be included in - the ``input_audio_buffer.speech_stopped`` event (unless the client manually commits the audio - buffer during VAD activation). - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_SPEECH_STARTED - :ivar audio_start_ms: Milliseconds from the start of all audio written to the buffer during the - session when speech was first detected. This will correspond to the beginning of audio sent to - the model, and thus includes the ``prefix_padding_ms`` configured in the Session. Required. - :vartype audio_start_ms: int - :ivar item_id: The ID of the user message item that will be created when speech stops. - Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STARTED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.speech_started``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STARTED.""" - audio_start_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Milliseconds from the start of all audio written to the buffer during the session when speech - was first detected. This will correspond to the beginning of audio sent to the model, and thus - includes the ``prefix_padding_ms`` configured in the Session. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created when speech stops. Required.""" - - @overload - def __init__( - self, - *, - audio_start_ms: int, - item_id: 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.INPUT_AUDIO_BUFFER_SPEECH_STARTED # type: ignore - - -class ServerEventInputAudioBufferSpeechStopped(ServerEvent, discriminator="input_audio_buffer.speech_stopped"): - """Returned in ``server_vad`` mode when the server detects the end of speech in the audio buffer. - The server will also send an ``conversation.item.created`` event with the user message item - that is created from the audio buffer. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED. - :vartype type: str or ~azure.ai.voicelive.models.INPUT_AUDIO_BUFFER_SPEECH_STOPPED - :ivar audio_end_ms: Milliseconds since the session started when speech stopped. This will - correspond to the end of audio sent to the model, and thus includes the - ``min_silence_duration_ms`` configured in the Session. Required. - :vartype audio_end_ms: int - :ivar item_id: The ID of the user message item that will be created. Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.INPUT_AUDIO_BUFFER_SPEECH_STOPPED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``input_audio_buffer.speech_stopped``. Required. - INPUT_AUDIO_BUFFER_SPEECH_STOPPED.""" - audio_end_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Milliseconds since the session started when speech stopped. This will correspond to the end of - audio sent to the model, and thus includes the ``min_silence_duration_ms`` configured in the - Session. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the user message item that will be created. Required.""" - - @overload - def __init__( - self, - *, - audio_end_ms: int, - item_id: 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.INPUT_AUDIO_BUFFER_SPEECH_STOPPED # type: ignore - - -class ServerEventMcpListToolsCompleted(ServerEvent, discriminator="mcp_list_tools.completed"): - """MCP list tools completed message. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. MCP_LIST_TOOLS_COMPLETED. - :vartype type: str or ~azure.ai.voicelive.models.MCP_LIST_TOOLS_COMPLETED - :ivar item_id: The item ID. Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.MCP_LIST_TOOLS_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MCP_LIST_TOOLS_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item ID. Required.""" - - @overload - def __init__( - self, - *, - item_id: 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.MCP_LIST_TOOLS_COMPLETED # type: ignore - - -class ServerEventMcpListToolsFailed(ServerEvent, discriminator="mcp_list_tools.failed"): - """MCP list tools failed message. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. MCP_LIST_TOOLS_FAILED. - :vartype type: str or ~azure.ai.voicelive.models.MCP_LIST_TOOLS_FAILED - :ivar item_id: The item ID. Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.MCP_LIST_TOOLS_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MCP_LIST_TOOLS_FAILED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item ID. Required.""" - - @overload - def __init__( - self, - *, - item_id: 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.MCP_LIST_TOOLS_FAILED # type: ignore - - -class ServerEventMcpListToolsInProgress(ServerEvent, discriminator="mcp_list_tools.in_progress"): - """MCP list tools in progress message. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. MCP_LIST_TOOLS_IN_PROGRESS. - :vartype type: str or ~azure.ai.voicelive.models.MCP_LIST_TOOLS_IN_PROGRESS - :ivar item_id: The item ID. Required. - :vartype item_id: str - """ - - type: Literal[ServerEventType.MCP_LIST_TOOLS_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. MCP_LIST_TOOLS_IN_PROGRESS.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The item ID. Required.""" - - @overload - def __init__( - self, - *, - item_id: 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.MCP_LIST_TOOLS_IN_PROGRESS # type: ignore - - -class ServerEventOutputAudioBufferCleared(ServerEvent, discriminator="output_audio_buffer.cleared"): - """Returned when the output audio buffer has been cleared. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``output_audio_buffer.cleared``. Required. Output audio - buffer has been cleared. - :vartype type: str or ~azure.ai.voicelive.models.OUTPUT_AUDIO_BUFFER_CLEARED - """ - - type: Literal[ServerEventType.OUTPUT_AUDIO_BUFFER_CLEARED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``output_audio_buffer.cleared``. Required. Output audio buffer has been - cleared.""" - - @overload - def __init__( - self, - *, - 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.OUTPUT_AUDIO_BUFFER_CLEARED # type: ignore - - -class ServerEventResponseAnimationBlendshapeDelta( - ServerEvent, discriminator="response.animation_blendshapes.delta" -): # pylint: disable=name-too-long - """Represents a delta update of blendshape animation frames for a specific output of a response. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_ANIMATION_BLENDSHAPES_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_ANIMATION_BLENDSHAPES_DELTA - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar frames: Required. Is either a [[float]] type or a str type. - :vartype frames: list[list[float]] or str - :ivar frame_index: Required. - :vartype frame_index: int - """ - - type: Literal[ServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_ANIMATION_BLENDSHAPES_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - frames: Union[list[list[float]], str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a [[float]] type or a str type.""" - frame_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - frames: Union[list[list[float]], str], - frame_index: int, - 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.RESPONSE_ANIMATION_BLENDSHAPES_DELTA # type: ignore - - -class ServerEventResponseAnimationBlendshapeDone( - ServerEvent, discriminator="response.animation_blendshapes.done" -): # pylint: disable=name-too-long - """Indicates the completion of blendshape animation processing for a specific output of a - response. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_ANIMATION_BLENDSHAPES_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_ANIMATION_BLENDSHAPES_DONE - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - """ - - type: Literal[ServerEventType.RESPONSE_ANIMATION_BLENDSHAPES_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_ANIMATION_BLENDSHAPES_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - 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.RESPONSE_ANIMATION_BLENDSHAPES_DONE # type: ignore - - -class ServerEventResponseAnimationVisemeDelta(ServerEvent, discriminator="response.animation_viseme.delta"): - """Represents a viseme ID delta update for animation based on audio. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_ANIMATION_VISEME_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_ANIMATION_VISEME_DELTA - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int - :ivar viseme_id: Required. - :vartype viseme_id: int - """ - - type: Literal[ServerEventType.RESPONSE_ANIMATION_VISEME_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_ANIMATION_VISEME_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - viseme_id: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - audio_offset_ms: int, - viseme_id: int, - 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.RESPONSE_ANIMATION_VISEME_DELTA # type: ignore - - -class ServerEventResponseAnimationVisemeDone(ServerEvent, discriminator="response.animation_viseme.done"): - """Indicates completion of viseme animation delivery for a response. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_ANIMATION_VISEME_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_ANIMATION_VISEME_DONE - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Literal[ServerEventType.RESPONSE_ANIMATION_VISEME_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_ANIMATION_VISEME_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - 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.RESPONSE_ANIMATION_VISEME_DONE # type: ignore - - -class ServerEventResponseAudioDelta(ServerEvent, discriminator="response.audio.delta"): - """Returned when the model-generated audio is updated. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.audio.delta``. Required. RESPONSE_AUDIO_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: Base64-encoded audio data delta. Required. - :vartype delta: bytes - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.audio.delta``. Required. RESPONSE_AUDIO_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: bytes = rest_field(visibility=["read", "create", "update", "delete", "query"], format="base64") - """Base64-encoded audio data delta. Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: bytes, - 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.RESPONSE_AUDIO_DELTA # type: ignore - - -class ServerEventResponseAudioDone(ServerEvent, discriminator="response.audio.done"): - """Returned when the model-generated audio is done. Also emitted when a Response is interrupted, - incomplete, or cancelled. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.audio.done``. Required. RESPONSE_AUDIO_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.audio.done``. Required. RESPONSE_AUDIO_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - 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.RESPONSE_AUDIO_DONE # type: ignore - - -class ServerEventResponseAudioTimestampDelta(ServerEvent, discriminator="response.audio_timestamp.delta"): - """Represents a word-level audio timestamp delta for a response. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_AUDIO_TIMESTAMP_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_TIMESTAMP_DELTA - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - :ivar audio_offset_ms: Required. - :vartype audio_offset_ms: int - :ivar audio_duration_ms: Required. - :vartype audio_duration_ms: int - :ivar text: Required. - :vartype text: str - :ivar timestamp_type: Required. Default value is "word". - :vartype timestamp_type: str - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_TIMESTAMP_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_AUDIO_TIMESTAMP_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - audio_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Default value is \"word\".""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - audio_offset_ms: int, - audio_duration_ms: int, - text: 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.RESPONSE_AUDIO_TIMESTAMP_DELTA # type: ignore - self.timestamp_type: Literal["word"] = "word" - - -class ServerEventResponseAudioTimestampDone(ServerEvent, discriminator="response.audio_timestamp.done"): - """Indicates completion of audio timestamp delivery for a response. - - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_AUDIO_TIMESTAMP_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_TIMESTAMP_DONE - :ivar response_id: Required. - :vartype response_id: str - :ivar item_id: Required. - :vartype item_id: str - :ivar output_index: Required. - :vartype output_index: int - :ivar content_index: Required. - :vartype content_index: int - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_TIMESTAMP_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_AUDIO_TIMESTAMP_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - 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.RESPONSE_AUDIO_TIMESTAMP_DONE # type: ignore - - -class ServerEventResponseAudioTranscriptAnnotationAdded( - ServerEvent, discriminator="response.audio_transcript.annotation.added" -): # pylint: disable=name-too-long - """Returned when an audio transcript annotation is added to a response. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.audio_transcript.annotation.added``. Required. - Audio transcript annotation added. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_TRANSCRIPT_ANNOTATION_ADDED - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar annotation_index: The index of the annotation. Required. - :vartype annotation_index: int - :ivar annotation: The annotation object. Required. - :vartype annotation: any - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_TRANSCRIPT_ANNOTATION_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.audio_transcript.annotation.added``. Required. Audio - transcript annotation added.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - annotation_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the annotation. Required.""" - annotation: Any = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The annotation object. Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - annotation_index: int, - annotation: Any, - 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.RESPONSE_AUDIO_TRANSCRIPT_ANNOTATION_ADDED # type: ignore - - -class ServerEventResponseAudioTranscriptDelta(ServerEvent, discriminator="response.audio_transcript.delta"): - """Returned when the model-generated transcription of audio output is updated. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.audio_transcript.delta``. Required. - RESPONSE_AUDIO_TRANSCRIPT_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_TRANSCRIPT_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: The transcript delta. Required. - :vartype delta: str - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_TRANSCRIPT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.audio_transcript.delta``. Required. - RESPONSE_AUDIO_TRANSCRIPT_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The transcript delta. Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - delta: 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.RESPONSE_AUDIO_TRANSCRIPT_DELTA # type: ignore - - -class ServerEventResponseAudioTranscriptDone(ServerEvent, discriminator="response.audio_transcript.done"): - """Returned when the model-generated transcription of audio output is done streaming. Also emitted - when a Response is interrupted, incomplete, or cancelled. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.audio_transcript.done``. Required. - RESPONSE_AUDIO_TRANSCRIPT_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_AUDIO_TRANSCRIPT_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar transcript: The final transcript of the audio. Required. - :vartype transcript: str - """ - - type: Literal[ServerEventType.RESPONSE_AUDIO_TRANSCRIPT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.audio_transcript.done``. Required. - RESPONSE_AUDIO_TRANSCRIPT_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - transcript: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final transcript of the audio. Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - transcript: 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.RESPONSE_AUDIO_TRANSCRIPT_DONE # type: ignore - - -class ServerEventResponseContentPartAdded(ServerEvent, discriminator="response.content_part.added"): - """Returned when a new content part is added to an assistant message item during response - generation. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.content_part.added``. Required. - RESPONSE_CONTENT_PART_ADDED. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_CONTENT_PART_ADDED - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item to which the content part was added. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar part: The content part that was added. Required. - :vartype part: ~azure.ai.voicelive.models.ContentPart - """ - - type: Literal[ServerEventType.RESPONSE_CONTENT_PART_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.content_part.added``. Required. RESPONSE_CONTENT_PART_ADDED.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item to which the content part was added. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - part: "_models.ContentPart" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content part that was added. Required.""" - - @overload - def __init__( - self, - *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.ContentPart", - 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.RESPONSE_CONTENT_PART_ADDED # type: ignore - - -class ServerEventResponseContentPartDone(ServerEvent, discriminator="response.content_part.done"): - """Returned when a content part is done streaming in an assistant message item. Also emitted when - a Response is interrupted, incomplete, or cancelled. - - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.content_part.done``. Required. - RESPONSE_CONTENT_PART_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_CONTENT_PART_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar part: The content part that is done. Required. - :vartype part: ~azure.ai.voicelive.models.ContentPart - """ - - type: Literal[ServerEventType.RESPONSE_CONTENT_PART_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.content_part.done``. Required. RESPONSE_CONTENT_PART_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - part: "_models.ContentPart" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The content part that is done. Required.""" - @overload def __init__( self, *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - part: "_models.ContentPart", - event_id: Optional[str] = None, + id: str, # pylint: disable=redefined-builtin + model: str, + output_modalities: Optional[list[Union[str, "_models.SessionModality"]]] = None, + instructions: Optional[str] = None, + audio: Optional["_models.AudioConfig"] = None, + include: Optional[list[str]] = None, + tools: Optional[list["_unions.VoiceLiveTool"]] = None, + tool_choice: Optional["_unions.VoiceLiveToolChoice"] = None, + parallel_tool_calls: Optional[bool] = None, + reasoning: Optional["_models.RealtimeReasoning"] = None, + max_output_tokens: Optional[Union[int, Literal["inf"]]] = None, + animation: Optional["_models.Animation"] = None, + avatar: Optional["_models.AvatarConfig"] = None, + temperature: Optional[float] = None, + interim_response: Optional["_unions.InterimResponseConfig"] = None, + voice_adaptation: Optional["_models.VoiceAdaptation"] = None, + response_delimiter: Optional[str] = None, + metadata: Optional[dict[str, str]] = None, + agent: Optional["_models.AgentConfig"] = None, + expires_at: Optional[datetime.datetime] = None, ) -> None: ... @overload @@ -6793,32 +4727,44 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_CONTENT_PART_DONE # type: ignore + self.type: Literal["realtime"] = "realtime" + self.object: Literal["realtime.session"] = "realtime.session" -class ServerEventResponseCreated(ServerEvent, discriminator="response.created"): - """Returned when a new Response is created. The first event of response creation, where the - response is in an initial state of ``in_progress``. +class ResponseStatusDetails(_Model): + """ResponseStatusDetails. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.created``. Required. RESPONSE_CREATED. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_CREATED - :ivar response: Required. - :vartype response: ~azure.ai.voicelive.models.Response + :ivar type: Is one of the following types: Literal["completed"], Literal["cancelled"], + Literal["failed"], Literal["incomplete"] + :vartype type: str or str or str or str + :ivar reason: Is one of the following types: Literal["turn_detected"], + Literal["client_cancelled"], Literal["max_output_tokens"], Literal["content_filter"] + :vartype reason: str or str or str or str + :ivar error: + :vartype error: ~azure.ai.voicelive.models.ResponseStatusDetailsError """ - type: Literal[ServerEventType.RESPONSE_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.created``. Required. RESPONSE_CREATED.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"completed\"], Literal[\"cancelled\"], + Literal[\"failed\"], Literal[\"incomplete\"]""" + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"turn_detected\"], Literal[\"client_cancelled\"], + Literal[\"max_output_tokens\"], Literal[\"content_filter\"]""" + error: Optional["_models.ResponseStatusDetailsError"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - response: "_models.Response", - event_id: Optional[str] = None, + type: Optional[Literal["completed", "cancelled", "failed", "incomplete"]] = None, + reason: Optional[Literal["turn_detected", "client_cancelled", "max_output_tokens", "content_filter"]] = None, + error: Optional["_models.ResponseStatusDetailsError"] = None, ) -> None: ... @overload @@ -6830,33 +4776,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_CREATED # type: ignore -class ServerEventResponseDone(ServerEvent, discriminator="response.done"): - """Returned when a Response is done streaming. Always emitted, no matter the final state. The - Response object included in the ``response.done`` event will include all output Items in the - Response but will omit the raw audio data. +class ResponseStatusDetailsError(_Model): + """ResponseStatusDetailsError. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.done``. Required. RESPONSE_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_DONE - :ivar response: Required. - :vartype response: ~azure.ai.voicelive.models.Response + :ivar type: + :vartype type: str + :ivar code: + :vartype code: str """ - type: Literal[ServerEventType.RESPONSE_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.done``. Required. RESPONSE_DONE.""" - response: "_models.Response" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - response: "_models.Response", - event_id: Optional[str] = None, + type: Optional[str] = None, + code: Optional[str] = None, ) -> None: ... @overload @@ -6868,50 +4807,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_DONE # type: ignore -class ServerEventResponseFileSearchCallCompleted( - ServerEvent, discriminator="response.file_search_call.completed" -): # pylint: disable=name-too-long - """Returned when a file search call has completed. +class ResponseUsageInputTokenDetails(_Model): + """ResponseUsageInputTokenDetails. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.file_search_call.completed``. Required. File - search call completed. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_FILE_SEARCH_CALL_COMPLETED - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar sequence_number: The sequence number of the file search call. Required. - :vartype sequence_number: int + :ivar cached_tokens: + :vartype cached_tokens: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int + :ivar cached_tokens_details: + :vartype cached_tokens_details: + ~azure.ai.voicelive.models.ResponseUsageInputTokenDetailsCachedTokensDetails """ - type: Literal[ServerEventType.RESPONSE_FILE_SEARCH_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.file_search_call.completed``. Required. File search call - completed.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sequence number of the file search call. Required.""" + cached_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + cached_tokens_details: Optional["_models.ResponseUsageInputTokenDetailsCachedTokensDetails"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) @overload def __init__( self, *, - response_id: str, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, + cached_tokens: Optional[int] = None, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, + cached_tokens_details: Optional["_models.ResponseUsageInputTokenDetailsCachedTokensDetails"] = None, ) -> None: ... @overload @@ -6923,50 +4853,30 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_FILE_SEARCH_CALL_COMPLETED # type: ignore -class ServerEventResponseFileSearchCallInProgress( - ServerEvent, discriminator="response.file_search_call.in_progress" -): # pylint: disable=name-too-long - """Returned when a file search call is in progress. +class ResponseUsageInputTokenDetailsCachedTokensDetails(_Model): # pylint: disable=name-too-long + """ResponseUsageInputTokenDetailsCachedTokensDetails. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.file_search_call.in_progress``. Required. File - search call is in progress. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar sequence_number: The sequence number of the file search call. Required. - :vartype sequence_number: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar image_tokens: + :vartype image_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - type: Literal[ServerEventType.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.file_search_call.in_progress``. Required. File search call - is in progress.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sequence number of the file search call. Required.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + image_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - response_id: str, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, + text_tokens: Optional[int] = None, + image_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -6978,50 +4888,26 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS # type: ignore -class ServerEventResponseFileSearchCallSearching( - ServerEvent, discriminator="response.file_search_call.searching" -): # pylint: disable=name-too-long - """Returned when a file search call is searching. +class ResponseUsageOutputTokenDetails(_Model): + """ResponseUsageOutputTokenDetails. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.file_search_call.searching``. Required. File - search call is searching. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_FILE_SEARCH_CALL_SEARCHING - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar sequence_number: The sequence number of the file search call. Required. - :vartype sequence_number: int + :ivar text_tokens: + :vartype text_tokens: int + :ivar audio_tokens: + :vartype audio_tokens: int """ - type: Literal[ServerEventType.RESPONSE_FILE_SEARCH_CALL_SEARCHING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.file_search_call.searching``. Required. File search call is - searching.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The sequence number of the file search call. Required.""" + text_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + audio_tokens: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - response_id: str, - item_id: str, - output_index: int, - sequence_number: int, - event_id: Optional[str] = None, + text_tokens: Optional[int] = None, + audio_tokens: Optional[int] = None, ) -> None: ... @overload @@ -7033,55 +4919,38 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_FILE_SEARCH_CALL_SEARCHING # type: ignore -class ServerEventResponseFunctionCallArgumentsDelta( - ServerEvent, discriminator="response.function_call_arguments.delta" -): # pylint: disable=name-too-long - """Returned when the model-generated function call arguments are updated. +class ResponseWebSearchCallItem(AzureResponseItem, discriminator="web_search_call"): + """A response item that represents a web search call. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the function call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar call_id: The ID of the function call. Required. - :vartype call_id: str - :ivar delta: The arguments delta as a JSON string. Required. - :vartype delta: str + :ivar id: + :vartype id: str + :ivar object: Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always 'web_search_call'. Required. Web search call item. + :vartype type: str or ~azure.ai.voicelive.models.WEB_SEARCH_CALL + :ivar status: The status of the web search tool call. Required. Is one of the following types: + Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str + :vartype status: str or str or str or str or str """ - type: Literal[ServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.function_call_arguments.delta``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The arguments delta as a JSON string. Required.""" + type: Literal[ItemType.WEB_SEARCH_CALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The type of the item. Always 'web_search_call'. Required. Web search call item.""" + status: Union[Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """The status of the web search tool call. Required. Is one of the following types: + Literal[\"in_progress\"], Literal[\"searching\"], Literal[\"completed\"], Literal[\"failed\"], + str""" @overload def __init__( self, *, - response_id: str, - item_id: str, - output_index: int, - call_id: str, - delta: str, - event_id: Optional[str] = None, + status: Union[Literal["in_progress"], Literal["searching"], Literal["completed"], Literal["failed"], str], + id: Optional[str] = None, # pylint: disable=redefined-builtin + object: Optional[Literal["realtime.item"]] = None, ) -> None: ... @overload @@ -7093,61 +4962,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA # type: ignore + self.type = ItemType.WEB_SEARCH_CALL # type: ignore -class ServerEventResponseFunctionCallArgumentsDone( - ServerEvent, discriminator="response.function_call_arguments.done" -): # pylint: disable=name-too-long - """Returned when the model-generated function call arguments are done streaming. Also emitted when - a Response is interrupted, incomplete, or cancelled. +class RtcCallErrorDetails(_Model): + """Error details for RTC call errors. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the function call item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar call_id: The ID of the function call. Required. - :vartype call_id: str - :ivar arguments: The final arguments as a JSON string. Required. - :vartype arguments: str - :ivar name: The name of the function call. Required. - :vartype name: str + :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: Literal[ServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.function_call_arguments.done``. Required. - RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - call_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the function call. Required.""" - arguments: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final arguments as a JSON string. Required.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of the function call. Required.""" + 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, *, - response_id: str, - item_id: str, - output_index: int, - call_id: str, - arguments: str, - name: str, - event_id: Optional[str] = None, + type: str, + message: str, + code: Optional[str] = None, ) -> None: ... @overload @@ -7159,33 +5001,68 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_FUNCTION_CALL_ARGUMENTS_DONE # type: ignore -class ServerEventResponseInvocationDelta(ServerEvent, discriminator="response.invocation.delta"): - """Returned when a hosted agent invocation produces a non-speech SSE event, passed through as-is. +class Scene(_Model): + """Configuration for avatar's zoom level, position, rotation and movement amplitude in the video + frame. - :ivar event_id: - :vartype event_id: str - :ivar type: The event type, must be ``response.invocation.delta``. Required. Invocation - passthrough delta from hosted agent. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_INVOCATION_DELTA - :ivar delta: The raw event data from the hosted agent invocation. Required. - :vartype delta: dict[str, any] + :ivar zoom: Zoom level of the avatar. Range is (0, +∞). Values less than 1 zoom out, values + greater than 1 zoom in. + :vartype zoom: float + :ivar position_x: Horizontal position of the avatar. Range is [-1, 1], as a proportion of frame + width. Negative values move left, positive values move right. + :vartype position_x: float + :ivar position_y: Vertical position of the avatar. Range is [-1, 1], as a proportion of frame + height. Negative values move up, positive values move down. + :vartype position_y: float + :ivar rotation_x: Rotation around the X-axis (pitch). Range is [-π, π] in radians. Negative + values rotate up, positive values rotate down. + :vartype rotation_x: float + :ivar rotation_y: Rotation around the Y-axis (yaw). Range is [-π, π] in radians. Negative + values rotate left, positive values rotate right. + :vartype rotation_y: float + :ivar rotation_z: Rotation around the Z-axis (roll). Range is [-π, π] in radians. Negative + values rotate anticlockwise, positive values rotate clockwise. + :vartype rotation_z: float + :ivar amplitude: Amplitude of the avatar movement. Range is (0, 1]. Values in (0, 1) mean + reduced amplitude, 1 means full amplitude. + :vartype amplitude: float """ - type: Literal[ServerEventType.RESPONSE_INVOCATION_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.invocation.delta``. Required. Invocation passthrough delta - from hosted agent.""" - delta: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The raw event data from the hosted agent invocation. Required.""" + zoom: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Zoom level of the avatar. Range is (0, +∞). Values less than 1 zoom out, values greater than 1 + zoom in.""" + position_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Horizontal position of the avatar. Range is [-1, 1], as a proportion of frame width. Negative + values move left, positive values move right.""" + position_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Vertical position of the avatar. Range is [-1, 1], as a proportion of frame height. Negative + values move up, positive values move down.""" + rotation_x: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Rotation around the X-axis (pitch). Range is [-π, π] in radians. Negative values rotate up, + positive values rotate down.""" + rotation_y: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Rotation around the Y-axis (yaw). Range is [-π, π] in radians. Negative values rotate left, + positive values rotate right.""" + rotation_z: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Rotation around the Z-axis (roll). Range is [-π, π] in radians. Negative values rotate + anticlockwise, positive values rotate clockwise.""" + amplitude: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Amplitude of the avatar movement. Range is (0, 1]. Values in (0, 1) mean reduced amplitude, 1 + means full amplitude.""" @overload def __init__( self, *, - delta: dict[str, Any], - event_id: Optional[str] = None, + zoom: Optional[float] = None, + position_x: Optional[float] = None, + position_y: Optional[float] = None, + rotation_x: Optional[float] = None, + rotation_y: Optional[float] = None, + rotation_z: Optional[float] = None, + amplitude: Optional[float] = None, ) -> None: ... @overload @@ -7197,51 +5074,73 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_INVOCATION_DELTA # type: ignore -class ServerEventResponseMcpCallArgumentsDelta(ServerEvent, discriminator="response.mcp_call_arguments.delta"): - """Represents a delta update of the arguments for an MCP tool call. +class ServerEvent(_Model): + """A realtime server event. - :ivar event_id: - :vartype event_id: str - :ivar type: Required. RESPONSE_MCP_CALL_ARGUMENTS_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_MCP_CALL_ARGUMENTS_DELTA - :ivar delta: The delta of the arguments. Required. - :vartype delta: str - :ivar item_id: The ID of the item associated with the event. Required. - :vartype item_id: str - :ivar response_id: The ID of the response associated with the event. Required. - :vartype response_id: str - :ivar output_index: The index of the output associated with the event. Required. - :vartype output_index: int - :ivar obfuscation: The obfuscation of the arguments. - :vartype obfuscation: str + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ServerEventBYOMCredentialUpdated, ServerEventResponseAudioTimestampDelta, + ServerEventResponseAudioTimestampDone, ServerEventResponseFileSearchCallCompleted, + ServerEventResponseFileSearchCallInProgress, ServerEventResponseFileSearchCallSearching, + ServerEventResponseInvocationDelta, ServerEventResponseVideoDelta, + ServerEventResponseWebSearchCallCompleted, ServerEventResponseWebSearchCallInProgress, + ServerEventResponseWebSearchCallSearching, ServerEventRtcCallError, + ServerEventRtcCallSdpCreated, ServerEventSessionAvatarConnecting, + ServerEventSessionAvatarSwitchToIdle, ServerEventSessionAvatarSwitchToSpeaking, + ServerEventWarning + + :ivar type: Required. Known values are: "conversation.created", "conversation.item.created", + "conversation.item.deleted", "conversation.item.input_audio_transcription.completed", + "conversation.item.input_audio_transcription.delta", + "conversation.item.input_audio_transcription.failed", "conversation.item.retrieved", + "conversation.item.truncated", "error", "input_audio_buffer.cleared", + "input_audio_buffer.committed", "input_audio_buffer.dtmf_event_received", + "input_audio_buffer.speech_started", "input_audio_buffer.speech_stopped", + "rate_limits.updated", "response.output_audio.delta", "response.output_audio.done", + "response.output_audio_transcript.delta", "response.output_audio_transcript.done", + "response.content_part.added", "response.content_part.done", "response.created", + "response.done", "response.function_call_arguments.delta", + "response.function_call_arguments.done", "response.output_item.added", + "response.output_item.done", "response.output_text.delta", "response.output_text.done", + "session.created", "session.updated", "output_audio_buffer.started", + "output_audio_buffer.stopped", "output_audio_buffer.cleared", "conversation.item.added", + "conversation.item.done", "input_audio_buffer.timeout_triggered", + "conversation.item.input_audio_transcription.segment", "mcp_list_tools.in_progress", + "mcp_list_tools.completed", "mcp_list_tools.failed", "response.mcp_call_arguments.delta", + "response.mcp_call_arguments.done", "response.mcp_call.in_progress", + "response.mcp_call.completed", and "response.mcp_call.failed". + :vartype type: str or ~azure.ai.voicelive.models.RealtimeServerEventType """ - type: Literal[ServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_MCP_CALL_ARGUMENTS_DELTA.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The delta of the arguments. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with the event. Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response associated with the event. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output associated with the event. Required.""" - obfuscation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The obfuscation of the arguments.""" + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"conversation.created\", \"conversation.item.created\", + \"conversation.item.deleted\", \"conversation.item.input_audio_transcription.completed\", + \"conversation.item.input_audio_transcription.delta\", + \"conversation.item.input_audio_transcription.failed\", \"conversation.item.retrieved\", + \"conversation.item.truncated\", \"error\", \"input_audio_buffer.cleared\", + \"input_audio_buffer.committed\", \"input_audio_buffer.dtmf_event_received\", + \"input_audio_buffer.speech_started\", \"input_audio_buffer.speech_stopped\", + \"rate_limits.updated\", \"response.output_audio.delta\", \"response.output_audio.done\", + \"response.output_audio_transcript.delta\", \"response.output_audio_transcript.done\", + \"response.content_part.added\", \"response.content_part.done\", \"response.created\", + \"response.done\", \"response.function_call_arguments.delta\", + \"response.function_call_arguments.done\", \"response.output_item.added\", + \"response.output_item.done\", \"response.output_text.delta\", \"response.output_text.done\", + \"session.created\", \"session.updated\", \"output_audio_buffer.started\", + \"output_audio_buffer.stopped\", \"output_audio_buffer.cleared\", \"conversation.item.added\", + \"conversation.item.done\", \"input_audio_buffer.timeout_triggered\", + \"conversation.item.input_audio_transcription.segment\", \"mcp_list_tools.in_progress\", + \"mcp_list_tools.completed\", \"mcp_list_tools.failed\", \"response.mcp_call_arguments.delta\", + \"response.mcp_call_arguments.done\", \"response.mcp_call.in_progress\", + \"response.mcp_call.completed\", and \"response.mcp_call.failed\".""" @overload def __init__( self, *, - delta: str, - item_id: str, - response_id: str, - output_index: int, - event_id: Optional[str] = None, - obfuscation: Optional[str] = None, + type: str, ) -> None: ... @overload @@ -7253,46 +5152,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DELTA # type: ignore -class ServerEventResponseMcpCallArgumentsDone(ServerEvent, discriminator="response.mcp_call_arguments.done"): - """Indicates the completion of the arguments for an MCP tool call. +class ServerEventBYOMCredentialUpdated(ServerEvent, discriminator="byom_credential.updated"): + """Confirms that BYOM authorization headers were updated. + :ivar type: The event type, must be ``byom_credential.updated``. Required. Default value is + "byom_credential.updated". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: Required. RESPONSE_MCP_CALL_ARGUMENTS_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_MCP_CALL_ARGUMENTS_DONE - :ivar item_id: The ID of the item associated with the event. Required. - :vartype item_id: str - :ivar response_id: The ID of the response associated with the event. Required. - :vartype response_id: str - :ivar output_index: The index of the output associated with the event. Required. - :vartype output_index: int - :ivar arguments: The full arguments for the tool call. - :vartype arguments: str + :ivar authorization_headers: Updated authorization header names with their values redacted. + Required. + :vartype authorization_headers: dict[str, str] """ - type: Literal[ServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_MCP_CALL_ARGUMENTS_DONE.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with the event. Required.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response associated with the event. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output associated with the event. Required.""" - arguments: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The full arguments for the tool call.""" + type: Literal["byom_credential.updated"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``byom_credential.updated``. Required. Default value is + \"byom_credential.updated\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + authorization_headers: dict[str, str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Updated authorization header names with their values redacted. Required.""" @overload def __init__( self, *, - item_id: str, - response_id: str, - output_index: int, + authorization_headers: dict[str, str], event_id: Optional[str] = None, - arguments: Optional[str] = None, ) -> None: ... @overload @@ -7304,35 +5191,40 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_MCP_CALL_ARGUMENTS_DONE # type: ignore + self.type = "byom_credential.updated" # type: ignore -class ServerEventResponseMcpCallCompleted(ServerEvent, discriminator="response.mcp_call.completed"): - """Indicates the MCP call has completed. +class ServerEventErrorDetails(_Model): + """ServerEventErrorDetails. + :ivar type: Required. + :vartype type: str + :ivar code: + :vartype code: str + :ivar message: Required. + :vartype message: str + :ivar param: + :vartype param: str :ivar event_id: :vartype event_id: str - :ivar type: Required. RESPONSE_MCP_CALL_COMPLETED. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_MCP_CALL_COMPLETED - :ivar item_id: The ID of the item associated with the event. Required. - :vartype item_id: str - :ivar output_index: The index of the output associated with the event. Required. - :vartype output_index: int """ - type: Literal[ServerEventType.RESPONSE_MCP_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_MCP_CALL_COMPLETED.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with the event. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output associated with the event. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - item_id: str, - output_index: int, + type: str, + message: str, + code: Optional[str] = None, + param: Optional[str] = None, event_id: Optional[str] = None, ) -> None: ... @@ -7345,35 +5237,64 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_MCP_CALL_COMPLETED # type: ignore -class ServerEventResponseMcpCallFailed(ServerEvent, discriminator="response.mcp_call.failed"): - """Indicates the MCP call has failed. +class ServerEventResponseAudioTimestampDelta(ServerEvent, discriminator="response.audio_timestamp.delta"): + """Represents a word-level audio timestamp delta for a response. + :ivar type: Required. Default value is "response.audio_timestamp.delta". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: Required. RESPONSE_MCP_CALL_FAILED. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_MCP_CALL_FAILED - :ivar item_id: The ID of the item associated with the event. Required. + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. :vartype item_id: str - :ivar output_index: The index of the output associated with the event. Required. + :ivar output_index: Required. :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int + :ivar audio_offset_ms: Required. + :vartype audio_offset_ms: int + :ivar audio_duration_ms: Required. + :vartype audio_duration_ms: int + :ivar text: Required. + :vartype text: str + :ivar timestamp_type: Required. Default value is "word". + :vartype timestamp_type: str """ - type: Literal[ServerEventType.RESPONSE_MCP_CALL_FAILED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_MCP_CALL_FAILED.""" + type: Literal["response.audio_timestamp.delta"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"response.audio_timestamp.delta\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with the event. Required.""" + """Required.""" output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output associated with the event. Required.""" + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_offset_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + audio_duration_ms: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + timestamp_type: Literal["word"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"word\".""" @overload def __init__( self, *, + response_id: str, item_id: str, output_index: int, + content_index: int, + audio_offset_ms: int, + audio_duration_ms: int, + text: str, event_id: Optional[str] = None, ) -> None: ... @@ -7386,35 +5307,47 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_MCP_CALL_FAILED # type: ignore + self.type = "response.audio_timestamp.delta" # type: ignore + self.timestamp_type: Literal["word"] = "word" -class ServerEventResponseMcpCallInProgress(ServerEvent, discriminator="response.mcp_call.in_progress"): - """Indicates the MCP call running. +class ServerEventResponseAudioTimestampDone(ServerEvent, discriminator="response.audio_timestamp.done"): + """Indicates completion of audio timestamp delivery for a response. + :ivar type: Required. Default value is "response.audio_timestamp.done". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: Required. RESPONSE_MCP_CALL_IN_PROGRESS. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_MCP_CALL_IN_PROGRESS - :ivar item_id: The ID of the item associated with the event. Required. + :ivar response_id: Required. + :vartype response_id: str + :ivar item_id: Required. :vartype item_id: str - :ivar output_index: The index of the output associated with the event. Required. + :ivar output_index: Required. :vartype output_index: int + :ivar content_index: Required. + :vartype content_index: int """ - type: Literal[ServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. RESPONSE_MCP_CALL_IN_PROGRESS.""" + type: Literal["response.audio_timestamp.done"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. Default value is \"response.audio_timestamp.done\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item associated with the event. Required.""" + """Required.""" output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output associated with the event. Required.""" + """Required.""" + content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, + response_id: str, item_id: str, output_index: int, + content_index: int, event_id: Optional[str] = None, ) -> None: ... @@ -7427,41 +5360,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_MCP_CALL_IN_PROGRESS # type: ignore + self.type = "response.audio_timestamp.done" # type: ignore -class ServerEventResponseOutputItemAdded(ServerEvent, discriminator="response.output_item.added"): - """Returned when a new Item is created during Response generation. +class ServerEventResponseFileSearchCallCompleted( + ServerEvent, discriminator="response.file_search_call.completed" +): # pylint: disable=name-too-long + """Returned when a file search call has completed. + :ivar type: The event type, must be ``response.file_search_call.completed``. Required. Default + value is "response.file_search_call.completed". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.output_item.added``. Required. - RESPONSE_OUTPUT_ITEM_ADDED. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_OUTPUT_ITEM_ADDED - :ivar response_id: The ID of the Response to which the item belongs. Required. + :ivar response_id: The ID of the response. Required. :vartype response_id: str - :ivar output_index: The index of the output item in the Response. Required. + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. :vartype output_index: int - :ivar item: - :vartype item: ~azure.ai.voicelive.models.ResponseItem + :ivar sequence_number: The sequence number of the file search call. Required. + :vartype sequence_number: int """ - type: Literal[ServerEventType.RESPONSE_OUTPUT_ITEM_ADDED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_item.added``. Required. RESPONSE_OUTPUT_ITEM_ADDED.""" + type: Literal["response.file_search_call.completed"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.file_search_call.completed``. Required. Default value is + \"response.file_search_call.completed\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Response to which the item belongs. Required.""" + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the Response. Required.""" - item: Optional["_models.ResponseItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the file search call. Required.""" @overload def __init__( self, *, response_id: str, + item_id: str, output_index: int, + sequence_number: int, event_id: Optional[str] = None, - item: Optional["_models.ResponseItem"] = None, ) -> None: ... @overload @@ -7473,42 +5416,51 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_OUTPUT_ITEM_ADDED # type: ignore + self.type = "response.file_search_call.completed" # type: ignore -class ServerEventResponseOutputItemDone(ServerEvent, discriminator="response.output_item.done"): - """Returned when an Item is done streaming. Also emitted when a Response is interrupted, - incomplete, or cancelled. +class ServerEventResponseFileSearchCallInProgress( + ServerEvent, discriminator="response.file_search_call.in_progress" +): # pylint: disable=name-too-long + """Returned when a file search call is in progress. + :ivar type: The event type, must be ``response.file_search_call.in_progress``. Required. + Default value is "response.file_search_call.in_progress". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.output_item.done``. Required. - RESPONSE_OUTPUT_ITEM_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_OUTPUT_ITEM_DONE - :ivar response_id: The ID of the Response to which the item belongs. Required. + :ivar response_id: The ID of the response. Required. :vartype response_id: str - :ivar output_index: The index of the output item in the Response. Required. + :ivar item_id: The ID of the item. Required. + :vartype item_id: str + :ivar output_index: The index of the output item in the response. Required. :vartype output_index: int - :ivar item: - :vartype item: ~azure.ai.voicelive.models.ResponseItem + :ivar sequence_number: The sequence number of the file search call. Required. + :vartype sequence_number: int """ - type: Literal[ServerEventType.RESPONSE_OUTPUT_ITEM_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.output_item.done``. Required. RESPONSE_OUTPUT_ITEM_DONE.""" + type: Literal["response.file_search_call.in_progress"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.file_search_call.in_progress``. Required. Default value is + \"response.file_search_call.in_progress\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the Response to which the item belongs. Required.""" + """The ID of the response. Required.""" + item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the item. Required.""" output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the Response. Required.""" - item: Optional["_models.ResponseItem"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The index of the output item in the response. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the file search call. Required.""" @overload def __init__( self, *, response_id: str, + item_id: str, output_index: int, + sequence_number: int, event_id: Optional[str] = None, - item: Optional["_models.ResponseItem"] = None, ) -> None: ... @overload @@ -7520,40 +5472,41 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_OUTPUT_ITEM_DONE # type: ignore + self.type = "response.file_search_call.in_progress" # type: ignore -class ServerEventResponseTextDelta(ServerEvent, discriminator="response.text.delta"): - """Returned when the text value of a "text" content part is updated. +class ServerEventResponseFileSearchCallSearching( + ServerEvent, discriminator="response.file_search_call.searching" +): # pylint: disable=name-too-long + """Returned when a file search call is searching. + :ivar type: The event type, must be ``response.file_search_call.searching``. Required. Default + value is "response.file_search_call.searching". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.text.delta``. Required. RESPONSE_TEXT_DELTA. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_TEXT_DELTA :ivar response_id: The ID of the response. Required. :vartype response_id: str :ivar item_id: The ID of the item. Required. :vartype item_id: str :ivar output_index: The index of the output item in the response. Required. :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar delta: The text delta. Required. - :vartype delta: str + :ivar sequence_number: The sequence number of the file search call. Required. + :vartype sequence_number: int """ - type: Literal[ServerEventType.RESPONSE_TEXT_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.text.delta``. Required. RESPONSE_TEXT_DELTA.""" + type: Literal["response.file_search_call.searching"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.file_search_call.searching``. Required. Default value is + \"response.file_search_call.searching\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the response. Required.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the item. Required.""" output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - delta: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The text delta. Required.""" + sequence_number: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The sequence number of the file search call. Required.""" @overload def __init__( @@ -7562,8 +5515,7 @@ def __init__( response_id: str, item_id: str, output_index: int, - content_index: int, - delta: str, + sequence_number: int, event_id: Optional[str] = None, ) -> None: ... @@ -7576,51 +5528,33 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_TEXT_DELTA # type: ignore + self.type = "response.file_search_call.searching" # type: ignore -class ServerEventResponseTextDone(ServerEvent, discriminator="response.text.done"): - """Returned when the text value of a "text" content part is done streaming. Also emitted when a - Response is interrupted, incomplete, or cancelled. +class ServerEventResponseInvocationDelta(ServerEvent, discriminator="response.invocation.delta"): + """Returned when a hosted agent invocation produces a non-speech SSE event, passed through as-is. + :ivar type: The event type, must be ``response.invocation.delta``. Required. Default value is + "response.invocation.delta". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.text.done``. Required. RESPONSE_TEXT_DONE. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_TEXT_DONE - :ivar response_id: The ID of the response. Required. - :vartype response_id: str - :ivar item_id: The ID of the item. Required. - :vartype item_id: str - :ivar output_index: The index of the output item in the response. Required. - :vartype output_index: int - :ivar content_index: The index of the content part in the item's content array. Required. - :vartype content_index: int - :ivar text: The final text content. Required. - :vartype text: str + :ivar delta: The raw event data from the hosted agent invocation. Required. + :vartype delta: dict[str, any] """ - type: Literal[ServerEventType.RESPONSE_TEXT_DONE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.text.done``. Required. RESPONSE_TEXT_DONE.""" - response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the response. Required.""" - item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the item. Required.""" - output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the output item in the response. Required.""" - content_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The index of the content part in the item's content array. Required.""" - text: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The final text content. Required.""" + type: Literal["response.invocation.delta"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.invocation.delta``. Required. Default value is + \"response.invocation.delta\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + delta: dict[str, Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The raw event data from the hosted agent invocation. Required.""" @overload def __init__( self, *, - response_id: str, - item_id: str, - output_index: int, - content_index: int, - text: str, + delta: dict[str, Any], event_id: Optional[str] = None, ) -> None: ... @@ -7633,17 +5567,17 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_TEXT_DONE # type: ignore + self.type = "response.invocation.delta" # type: ignore class ServerEventResponseVideoDelta(ServerEvent, discriminator="response.video.delta"): """Returned when avatar video frame data is streamed. + :ivar type: The event type, must be ``response.video.delta``. Required. Default value is + "response.video.delta". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.video.delta``. Required. Delta update for avatar - video frames. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_VIDEO_DELTA :ivar output_index: The index of the output item in the response. Required. :vartype output_index: int :ivar codec: The codec used for the video data. Required. @@ -7652,9 +5586,10 @@ class ServerEventResponseVideoDelta(ServerEvent, discriminator="response.video.d :vartype delta: str """ - type: Literal[ServerEventType.RESPONSE_VIDEO_DELTA] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.video.delta``. Required. Delta update for avatar video - frames.""" + type: Literal["response.video.delta"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.video.delta``. Required. Default value is + \"response.video.delta\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) output_index: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The index of the output item in the response. Required.""" codec: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7681,7 +5616,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_VIDEO_DELTA # type: ignore + self.type = "response.video.delta" # type: ignore class ServerEventResponseWebSearchCallCompleted( @@ -7689,11 +5624,11 @@ class ServerEventResponseWebSearchCallCompleted( ): # pylint: disable=name-too-long """Returned when a web search call has completed. + :ivar type: The event type, must be ``response.web_search_call.completed``. Required. Default + value is "response.web_search_call.completed". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.web_search_call.completed``. Required. Web - search call completed. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_WEB_SEARCH_CALL_COMPLETED :ivar response_id: The ID of the response. Required. :vartype response_id: str :ivar item_id: The ID of the item. Required. @@ -7704,9 +5639,10 @@ class ServerEventResponseWebSearchCallCompleted( :vartype sequence_number: int """ - type: Literal[ServerEventType.RESPONSE_WEB_SEARCH_CALL_COMPLETED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.web_search_call.completed``. Required. Web search call - completed.""" + type: Literal["response.web_search_call.completed"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.web_search_call.completed``. Required. Default value is + \"response.web_search_call.completed\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the response. Required.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7736,7 +5672,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_WEB_SEARCH_CALL_COMPLETED # type: ignore + self.type = "response.web_search_call.completed" # type: ignore class ServerEventResponseWebSearchCallInProgress( @@ -7744,11 +5680,11 @@ class ServerEventResponseWebSearchCallInProgress( ): # pylint: disable=name-too-long """Returned when a web search call is in progress. + :ivar type: The event type, must be ``response.web_search_call.in_progress``. Required. Default + value is "response.web_search_call.in_progress". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.web_search_call.in_progress``. Required. Web - search call is in progress. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS :ivar response_id: The ID of the response. Required. :vartype response_id: str :ivar item_id: The ID of the item. Required. @@ -7759,9 +5695,10 @@ class ServerEventResponseWebSearchCallInProgress( :vartype sequence_number: int """ - type: Literal[ServerEventType.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.web_search_call.in_progress``. Required. Web search call is - in progress.""" + type: Literal["response.web_search_call.in_progress"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.web_search_call.in_progress``. Required. Default value is + \"response.web_search_call.in_progress\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the response. Required.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7791,7 +5728,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS # type: ignore + self.type = "response.web_search_call.in_progress" # type: ignore class ServerEventResponseWebSearchCallSearching( @@ -7799,11 +5736,11 @@ class ServerEventResponseWebSearchCallSearching( ): # pylint: disable=name-too-long """Returned when a web search call is searching. + :ivar type: The event type, must be ``response.web_search_call.searching``. Required. Default + value is "response.web_search_call.searching". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``response.web_search_call.searching``. Required. Web - search call is searching. - :vartype type: str or ~azure.ai.voicelive.models.RESPONSE_WEB_SEARCH_CALL_SEARCHING :ivar response_id: The ID of the response. Required. :vartype response_id: str :ivar item_id: The ID of the item. Required. @@ -7814,9 +5751,10 @@ class ServerEventResponseWebSearchCallSearching( :vartype sequence_number: int """ - type: Literal[ServerEventType.RESPONSE_WEB_SEARCH_CALL_SEARCHING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``response.web_search_call.searching``. Required. Web search call is - searching.""" + type: Literal["response.web_search_call.searching"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``response.web_search_call.searching``. Required. Default value is + \"response.web_search_call.searching\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) response_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The ID of the response. Required.""" item_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) @@ -7846,33 +5784,43 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.RESPONSE_WEB_SEARCH_CALL_SEARCHING # type: ignore + self.type = "response.web_search_call.searching" # 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. +class ServerEventRtcCallError(ServerEvent, discriminator="rtc.call.error"): + """Returned when a WebRTC call operation fails. + :ivar type: The event type, must be ``rtc.call.error``. Required. Default value is + "rtc.call.error". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be 'session.avatar.connecting'. Required. - SESSION_AVATAR_CONNECTING. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_AVATAR_CONNECTING - :ivar server_sdp: The server's SDP answer for the avatar connection. Required. - :vartype server_sdp: str + :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.SESSION_AVATAR_CONNECTING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be 'session.avatar.connecting'. Required. SESSION_AVATAR_CONNECTING.""" - server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The server's SDP answer for the avatar connection. Required.""" + type: Literal["rtc.call.error"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``rtc.call.error``. Required. Default value is \"rtc.call.error\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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, *, - server_sdp: str, + error: "_models.RtcCallErrorDetails", event_id: Optional[str] = None, + operation: Optional[str] = None, + rtc_call_id: Optional[str] = None, ) -> None: ... @overload @@ -7884,33 +5832,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.SESSION_AVATAR_CONNECTING # type: ignore + self.type = "rtc.call.error" # type: ignore -class ServerEventSessionAvatarSwitchToIdle(ServerEvent, discriminator="session.avatar.switch_to_idle"): - """Returned when the avatar switches to idle state. +class ServerEventRtcCallSdpCreated(ServerEvent, discriminator="rtc.call.sdp.created"): + """Returned when the WebRTC SDP negotiation completes successfully. + :ivar type: The event type, must be ``rtc.call.sdp.created``. Required. Default value is + "rtc.call.sdp.created". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``session.avatar.switch_to_idle``. Required. Avatar - switches to idle state. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_AVATAR_SWITCH_TO_IDLE - :ivar turn_id: The ID of the turn associated with the avatar state change. - :vartype turn_id: str + :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.SESSION_AVATAR_SWITCH_TO_IDLE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.avatar.switch_to_idle``. Required. Avatar switches to idle - state.""" - turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the turn associated with the avatar state change.""" + type: Literal["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. Default value is + \"rtc.call.sdp.created\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + 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, - turn_id: Optional[str] = None, ) -> None: ... @overload @@ -7922,33 +5876,35 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.SESSION_AVATAR_SWITCH_TO_IDLE # type: ignore + self.type = "rtc.call.sdp.created" # type: ignore -class ServerEventSessionAvatarSwitchToSpeaking(ServerEvent, discriminator="session.avatar.switch_to_speaking"): - """Returned when the avatar switches to speaking state. +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. + :ivar type: The event type, must be 'session.avatar.connecting'. Required. Default value is + "session.avatar.connecting". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``session.avatar.switch_to_speaking``. Required. Avatar - switches to speaking state. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_AVATAR_SWITCH_TO_SPEAKING - :ivar turn_id: The ID of the turn associated with the avatar state change. - :vartype turn_id: str + :ivar server_sdp: The server's SDP answer for the avatar connection. Required. + :vartype server_sdp: str """ - type: Literal[ServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.avatar.switch_to_speaking``. Required. Avatar switches to - speaking state.""" - turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The ID of the turn associated with the avatar state change.""" + type: Literal["session.avatar.connecting"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be 'session.avatar.connecting'. Required. Default value is + \"session.avatar.connecting\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + server_sdp: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The server's SDP answer for the avatar connection. Required.""" @overload def __init__( self, *, + server_sdp: str, event_id: Optional[str] = None, - turn_id: Optional[str] = None, ) -> None: ... @overload @@ -7960,32 +5916,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.SESSION_AVATAR_SWITCH_TO_SPEAKING # type: ignore + self.type = "session.avatar.connecting" # type: ignore -class ServerEventSessionCreated(ServerEvent, discriminator="session.created"): - """Returned when a Session is created. Emitted automatically when a new connection is established - as the first server event. This event will contain the default Session configuration. +class ServerEventSessionAvatarSwitchToIdle(ServerEvent, discriminator="session.avatar.switch_to_idle"): + """Returned when the avatar switches to idle state. + :ivar type: The event type, must be ``session.avatar.switch_to_idle``. Required. Default value + is "session.avatar.switch_to_idle". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``session.created``. Required. SESSION_CREATED. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_CREATED - :ivar session: Required. - :vartype session: ~azure.ai.voicelive.models.ResponseSession + :ivar turn_id: The ID of the turn associated with the avatar state change. + :vartype turn_id: str """ - type: Literal[ServerEventType.SESSION_CREATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.created``. Required. SESSION_CREATED.""" - session: "_models.ResponseSession" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["session.avatar.switch_to_idle"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``session.avatar.switch_to_idle``. Required. Default value is + \"session.avatar.switch_to_idle\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the turn associated with the avatar state change.""" @overload def __init__( self, *, - session: "_models.ResponseSession", event_id: Optional[str] = None, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -7997,31 +5955,34 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.SESSION_CREATED # type: ignore + self.type = "session.avatar.switch_to_idle" # type: ignore -class ServerEventSessionUpdated(ServerEvent, discriminator="session.updated"): - """Returned when a session is updated with a ``session.update`` event, unless there is an error. +class ServerEventSessionAvatarSwitchToSpeaking(ServerEvent, discriminator="session.avatar.switch_to_speaking"): + """Returned when the avatar switches to speaking state. + :ivar type: The event type, must be ``session.avatar.switch_to_speaking``. Required. Default + value is "session.avatar.switch_to_speaking". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``session.updated``. Required. SESSION_UPDATED. - :vartype type: str or ~azure.ai.voicelive.models.SESSION_UPDATED - :ivar session: Required. - :vartype session: ~azure.ai.voicelive.models.ResponseSession + :ivar turn_id: The ID of the turn associated with the avatar state change. + :vartype turn_id: str """ - type: Literal[ServerEventType.SESSION_UPDATED] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``session.updated``. Required. SESSION_UPDATED.""" - session: "_models.ResponseSession" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal["session.avatar.switch_to_speaking"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``session.avatar.switch_to_speaking``. Required. Default value is + \"session.avatar.switch_to_speaking\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + turn_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the turn associated with the avatar state change.""" @overload def __init__( self, *, - session: "_models.ResponseSession", event_id: Optional[str] = None, + turn_id: Optional[str] = None, ) -> None: ... @overload @@ -8033,23 +5994,24 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.SESSION_UPDATED # type: ignore + self.type = "session.avatar.switch_to_speaking" # type: ignore class ServerEventWarning(ServerEvent, discriminator="warning"): """Returned when a warning occurs that does not interrupt the conversation flow. Warnings are informational and the session will continue normally. + :ivar type: The event type, must be ``warning``. Required. Default value is "warning". + :vartype type: str :ivar event_id: :vartype event_id: str - :ivar type: The event type, must be ``warning``. Required. WARNING. - :vartype type: str or ~azure.ai.voicelive.models.WARNING :ivar warning: Details of the warning. Required. :vartype warning: ~azure.ai.voicelive.models.ServerEventWarningDetails """ - type: Literal[ServerEventType.WARNING] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """The event type, must be ``warning``. Required. WARNING.""" + type: Literal["warning"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The event type, must be ``warning``. Required. Default value is \"warning\".""" + event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) warning: "_models.ServerEventWarningDetails" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -8072,7 +6034,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ServerEventType.WARNING # type: ignore + self.type = "warning" # type: ignore class ServerEventWarningDetails(_Model): @@ -8113,59 +6075,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServerVad(TurnDetection, discriminator="server_vad"): - """Base model for VAD-based turn detection. +class SessionBase(_Model): + """VoiceLive session object configuration.""" - :ivar type: Required. SERVER_VAD. - :vartype type: str or ~azure.ai.voicelive.models.SERVER_VAD - :ivar threshold: Activation threshold for VAD detection. Range: 0.0 to 1.0. - :vartype threshold: float - :ivar prefix_padding_ms: Amount of audio to include before speech is detected, in milliseconds. - :vartype prefix_padding_ms: int - :ivar silence_duration_ms: Duration of silence required to end speech detection, in - milliseconds. - :vartype silence_duration_ms: int - :ivar end_of_utterance_detection: Configuration for end-of-utterance detection. - :vartype end_of_utterance_detection: ~azure.ai.voicelive.models.EouDetection - :ivar auto_truncate: Whether to automatically truncate the audio buffer when speech stops. - :vartype auto_truncate: bool - :ivar create_response: Whether to automatically create a response when speech stops. - :vartype create_response: bool - :ivar interrupt_response: Whether to allow the user's speech to interrupt the assistant's - response. - :vartype interrupt_response: bool + +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 """ - type: Literal[TurnDetectionType.SERVER_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. SERVER_VAD.""" - threshold: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Activation threshold for VAD detection. Range: 0.0 to 1.0.""" - prefix_padding_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Amount of audio to include before speech is detected, in milliseconds.""" - silence_duration_ms: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Duration of silence required to end speech detection, in milliseconds.""" - end_of_utterance_detection: Optional["_models.EouDetection"] = rest_field( + 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"] ) - """Configuration for end-of-utterance detection.""" - auto_truncate: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to automatically truncate the audio buffer when speech stops.""" - create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to automatically create a response when speech stops.""" - interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Whether to allow the user's speech to interrupt the assistant's response.""" + """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: Optional[float] = None, - prefix_padding_ms: Optional[int] = None, - silence_duration_ms: Optional[int] = None, - end_of_utterance_detection: Optional["_models.EouDetection"] = None, - auto_truncate: Optional[bool] = None, - create_response: Optional[bool] = None, - interrupt_response: Optional[bool] = None, + threshold_level: Optional[Union[str, "_models.EouThresholdLevel"]] = None, + timeout_ms: Optional[int] = None, ) -> None: ... @overload @@ -8177,11 +6119,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = TurnDetectionType.SERVER_VAD # type: ignore - - -class SessionBase(_Model): - """VoiceLive session object configuration.""" + self.model = "smart_end_of_turn_detection" # type: ignore class StaticInterimResponseConfig(InterimResponseConfigBase, discriminator="static_interim_response"): @@ -8227,32 +6165,52 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class SystemMessageItem(MessageItem, discriminator="system"): - """A system message item within a conversation. + """Realtime system message item. - :ivar id: + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. :vartype id: str - :ivar type: The type of the item; must be 'message' for message items. Required. MESSAGE. - :vartype type: str or ~azure.ai.voicelive.models.MESSAGE - :ivar content: The content parts of the message. Required. - :vartype content: list[~azure.ai.voicelive.models.MessageContentPart] - :ivar status: Processing status of the message item. Known values are: "completed" and - "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ItemParamStatus - :ivar role: Required. SYSTEM. + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: str + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``system``. Required. SYSTEM. :vartype role: str or ~azure.ai.voicelive.models.SYSTEM + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.voicelive.models.RealtimeConversationItemMessageSystemContent] """ - __mapping__: dict[str, _Model] = {} - role: Literal[MessageRole.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. SYSTEM.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.SYSTEM] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``system``. Required. SYSTEM.""" + content: list["_models.RealtimeConversationItemMessageSystemContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" @overload def __init__( self, *, - content: list["_models.MessageContentPart"], + content: list["_models.RealtimeConversationItemMessageSystemContent"], id: Optional[str] = None, # pylint: disable=redefined-builtin - status: Optional[Union[str, "_models.ItemParamStatus"]] = None, + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -8264,48 +6222,36 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = MessageRole.SYSTEM # type: ignore + self.role = RealtimeConversationItemMessageType.SYSTEM # type: ignore + self.type: Literal["message"] = "message" -class TokenUsage(_Model): - """Overall usage statistics for a response. +class ToolChoiceParam(_Model): + """How the model should select which tool (or tools) to use when generating a response. See the + ``tools`` parameter to see how to specify which tools the model can call. - :ivar total_tokens: Total number of tokens (input + output). Required. - :vartype total_tokens: int - :ivar input_tokens: Number of input tokens. Required. - :vartype input_tokens: int - :ivar output_tokens: Number of output tokens. Required. - :vartype output_tokens: int - :ivar input_token_details: Detailed breakdown of input tokens. Required. - :vartype input_token_details: ~azure.ai.voicelive.models.InputTokenDetails - :ivar output_token_details: Detailed breakdown of output tokens. Required. - :vartype output_token_details: ~azure.ai.voicelive.models.OutputTokenDetails - """ - - total_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Total number of tokens (input + output). Required.""" - input_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of input tokens. Required.""" - output_tokens: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Number of output tokens. Required.""" - input_token_details: "_models.InputTokenDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Detailed breakdown of input tokens. Required.""" - output_token_details: "_models.OutputTokenDetails" = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Detailed breakdown of output tokens. Required.""" + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ToolChoiceFunction, ToolChoiceMCP + + :ivar type: Required. Known values are: "allowed_tools", "function", "mcp", "custom", + "apply_patch", "shell", "file_search", "web_search_preview", "computer_use_preview", + "web_search_preview_2025_03_11", "image_generation", "code_interpreter", "computer", and + "computer_use". + :vartype type: str or ~azure.ai.voicelive.models.ToolChoiceParamType + """ + + __mapping__: dict[str, _Model] = {} + type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) + """Required. Known values are: \"allowed_tools\", \"function\", \"mcp\", \"custom\", + \"apply_patch\", \"shell\", \"file_search\", \"web_search_preview\", \"computer_use_preview\", + \"web_search_preview_2025_03_11\", \"image_generation\", \"code_interpreter\", \"computer\", + and \"computer_use\".""" @overload def __init__( self, *, - total_tokens: int, - input_tokens: int, - output_tokens: int, - input_token_details: "_models.InputTokenDetails", - output_token_details: "_models.OutputTokenDetails", + type: str, ) -> None: ... @overload @@ -8319,25 +6265,25 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ToolChoiceSelection(_Model): - """A base representation for a voicelive tool_choice selecting a named tool. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - ToolChoiceFunctionSelection +class ToolChoiceFunction(ToolChoiceParam, discriminator="function"): + """Function tool. - :ivar type: Required. Known values are: "function" and "mcp". - :vartype type: str or ~azure.ai.voicelive.models.ToolType + :ivar type: For function calling, the type is always ``function``. Required. FUNCTION. + :vartype type: str or ~azure.ai.voicelive.models.FUNCTION + :ivar name: The name of the function to call. Required. + :vartype name: str """ - __mapping__: dict[str, _Model] = {} - type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) - """Required. Known values are: \"function\" and \"mcp\".""" + type: Literal[ToolChoiceParamType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For function calling, the type is always ``function``. Required. FUNCTION.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the function to call. Required.""" @overload def __init__( self, *, - type: str, + name: str, ) -> None: ... @overload @@ -8349,27 +6295,32 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type = ToolChoiceParamType.FUNCTION # type: ignore -class ToolChoiceFunctionSelection(ToolChoiceSelection, discriminator="function"): - """The representation of a voicelive tool_choice selecting a named function tool. +class ToolChoiceMCP(ToolChoiceParam, discriminator="mcp"): + """MCP tool. - :ivar type: Required. FUNCTION. - :vartype type: str or ~azure.ai.voicelive.models.FUNCTION - :ivar name: Required. + :ivar type: For MCP tools, the type is always ``mcp``. Required. MCP. + :vartype type: str or ~azure.ai.voicelive.models.MCP + :ivar server_label: The label of the MCP server to use. Required. + :vartype server_label: str + :ivar name: :vartype name: str """ - type: Literal[ToolType.FUNCTION] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. FUNCTION.""" - name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + type: Literal[ToolChoiceParamType.MCP] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """For MCP tools, the type is always ``mcp``. Required. MCP.""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The label of the MCP server to use. Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) @overload def __init__( self, *, - name: str, + server_label: str, + name: Optional[str] = None, ) -> None: ... @overload @@ -8381,7 +6332,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.type = ToolType.FUNCTION # type: ignore + self.type = ToolChoiceParamType.MCP # type: ignore class TranscriptionPhrase(_Model): @@ -8477,33 +6428,98 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class TurnDetectionSemanticVad(TurnDetection, discriminator="semantic_vad"): + """TurnDetectionSemanticVad. + + :ivar type: Required. SEMANTIC_VAD. + :vartype type: str or ~azure.ai.voicelive.models.SEMANTIC_VAD + :ivar eagerness: Is one of the following types: Literal["low"], Literal["medium"], + Literal["high"], Literal["auto"] + :vartype eagerness: str or str or str or str + :ivar create_response: + :vartype create_response: bool + :ivar interrupt_response: + :vartype interrupt_response: bool + """ + + type: Literal[TurnDetectionType.SEMANTIC_VAD] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Required. SEMANTIC_VAD.""" + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is one of the following types: Literal[\"low\"], Literal[\"medium\"], Literal[\"high\"], + Literal[\"auto\"]""" + create_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + interrupt_response: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + eagerness: Optional[Literal["low", "medium", "high", "auto"]] = None, + create_response: Optional[bool] = None, + interrupt_response: Optional[bool] = 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 = TurnDetectionType.SEMANTIC_VAD # type: ignore + + class UserMessageItem(MessageItem, discriminator="user"): - """A user message item within a conversation. + """Realtime user message item. - :ivar id: + :ivar id: The unique ID of the item. This may be provided by the client or generated by the + server. :vartype id: str - :ivar type: The type of the item; must be 'message' for message items. Required. MESSAGE. - :vartype type: str or ~azure.ai.voicelive.models.MESSAGE - :ivar content: The content parts of the message. Required. - :vartype content: list[~azure.ai.voicelive.models.MessageContentPart] - :ivar status: Processing status of the message item. Known values are: "completed" and - "incomplete". - :vartype status: str or ~azure.ai.voicelive.models.ItemParamStatus - :ivar role: Required. USER. + :ivar object: Identifier for the API object being returned - always ``realtime.item``. Optional + when creating a new item. Default value is "realtime.item". + :vartype object: str + :ivar type: The type of the item. Always ``message``. Required. Default value is "message". + :vartype type: str + :ivar status: The status of the item. Has no effect on the conversation. Is one of the + following types: Literal["completed"], Literal["incomplete"], Literal["in_progress"] + :vartype status: str or str or str + :ivar role: The role of the message sender. Always ``user``. Required. USER. :vartype role: str or ~azure.ai.voicelive.models.USER + :ivar content: The content of the message. Required. + :vartype content: list[~azure.ai.voicelive.models.RealtimeConversationItemMessageUserContent] """ - __mapping__: dict[str, _Model] = {} - role: Literal[MessageRole.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Required. USER.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The unique ID of the item. This may be provided by the client or generated by the server.""" + object: Optional[Literal["realtime.item"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Identifier for the API object being returned - always ``realtime.item``. Optional when creating + a new item. Default value is \"realtime.item\".""" + type: Literal["message"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The type of the item. Always ``message``. Required. Default value is \"message\".""" + status: Optional[Literal["completed", "incomplete", "in_progress"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The status of the item. Has no effect on the conversation. Is one of the following types: + Literal[\"completed\"], Literal[\"incomplete\"], Literal[\"in_progress\"]""" + role: Literal[RealtimeConversationItemMessageType.USER] = rest_discriminator(name="role", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The role of the message sender. Always ``user``. Required. USER.""" + content: list["_models.RealtimeConversationItemMessageUserContent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The content of the message. Required.""" @overload def __init__( self, *, - content: list["_models.MessageContentPart"], + content: list["_models.RealtimeConversationItemMessageUserContent"], id: Optional[str] = None, # pylint: disable=redefined-builtin - status: Optional[Union[str, "_models.ItemParamStatus"]] = None, + object: Optional[Literal["realtime.item"]] = None, + status: Optional[Literal["completed", "incomplete", "in_progress"]] = None, ) -> None: ... @overload @@ -8515,7 +6531,8 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) - self.role = MessageRole.USER # type: ignore + self.role = RealtimeConversationItemMessageType.USER # type: ignore + self.type: Literal["message"] = "message" class VideoCrop(_Model): @@ -8647,41 +6664,127 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class VoiceLiveErrorDetails(_Model): - """Error object returned in case of API failure. +class VoiceAdaptation(_Model): + """Voice-optimized instruction adaptation. - :ivar code: Error code, or null if unspecified. - :vartype code: str - :ivar message: Human-readable error message. Required. - :vartype message: str - :ivar param: Parameter name related to the error, if applicable. - :vartype param: str - :ivar type: Type or category of the error. + :ivar type: Adaptation strategy. Required. Default value is "auto". :vartype type: str - :ivar event_id: Event id of the error. - :vartype event_id: str + :ivar additional_instructions: Server-generated voice-optimized instructions. + :vartype additional_instructions: str """ - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Error code, or null if unspecified.""" - message: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Human-readable error message. Required.""" - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Parameter name related to the error, if applicable.""" - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Type or category of the error.""" - event_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Event id of the error.""" + type: Literal["auto"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Adaptation strategy. Required. Default value is \"auto\".""" + additional_instructions: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Server-generated voice-optimized instructions.""" @overload def __init__( self, *, - message: str, - code: Optional[str] = None, - param: Optional[str] = None, - type: Optional[str] = None, - event_id: Optional[str] = None, + additional_instructions: 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: Literal["auto"] = "auto" + + +class VoiceLiveMcpApprovalRules(_Model): + """Per-tool MCP approval rules. + + :ivar never: + :vartype never: list[str] + :ivar always: + :vartype always: list[str] + """ + + never: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + always: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + never: Optional[list[str]] = None, + always: Optional[list[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 VoiceLiveMcpTool(_Model): + """Remote MCP server configuration supported by VoiceLive. + + :ivar type: Required. Default value is "mcp". + :vartype type: str + :ivar server_label: Required. + :vartype server_label: str + :ivar server_url: Required. + :vartype server_url: str + :ivar authorization: Is either a str type or a AssignedManagedIdentity type. + :vartype authorization: str or ~azure.ai.voicelive.models.AssignedManagedIdentity + :ivar headers: + :vartype headers: dict[str, str] + :ivar allowed_tools: + :vartype allowed_tools: list[str] + :ivar require_approval: Is either a Union[str, "_models.VoiceLiveMcpApprovalMode"] type or a + VoiceLiveMcpApprovalRules type. + :vartype require_approval: str or ~azure.ai.voicelive.models.VoiceLiveMcpApprovalMode or + ~azure.ai.voicelive.models.VoiceLiveMcpApprovalRules + :ivar response_scheduling: Known values are: "silent", "when_idle", "interrupt", and + "skip_if_busy". + :vartype response_scheduling: str or ~azure.ai.voicelive.models.McpResponseScheduling + """ + + type: Literal["mcp"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Default value is \"mcp\".""" + server_label: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + server_url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + authorization: Optional["_unions.VoiceLiveMcpAuthorization"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a str type or a AssignedManagedIdentity type.""" + headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + allowed_tools: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + require_approval: Optional["_unions.VoiceLiveMcpRequireApproval"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Is either a Union[str, \"_models.VoiceLiveMcpApprovalMode\"] type or a + VoiceLiveMcpApprovalRules type.""" + response_scheduling: Optional[Union[str, "_models.McpResponseScheduling"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"silent\", \"when_idle\", \"interrupt\", and \"skip_if_busy\".""" + + @overload + def __init__( + self, + *, + server_label: str, + server_url: str, + authorization: Optional["_unions.VoiceLiveMcpAuthorization"] = None, + headers: Optional[dict[str, str]] = None, + allowed_tools: Optional[list[str]] = None, + require_approval: Optional["_unions.VoiceLiveMcpRequireApproval"] = None, + response_scheduling: Optional[Union[str, "_models.McpResponseScheduling"]] = None, ) -> None: ... @overload @@ -8693,3 +6796,4 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.type: Literal["mcp"] = "mcp" diff --git a/sdk/voicelive/azure-ai-voicelive/pyproject.toml b/sdk/voicelive/azure-ai-voicelive/pyproject.toml index 13768cdd3b71..caff75902a11 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 :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3",