1+ # pylint: disable=too-many-lines
12# -------------------------------------------------------------------------
23# Copyright (c) Microsoft Corporation. All rights reserved.
34# Licensed under the MIT License. See License.txt in the project root for
45# license information.
56# --------------------------------------------------------------------------
67from typing import List , Optional , Union , TYPE_CHECKING
8+ from enum import Enum
79from typing_extensions import Literal
810from ._generated .models import (
911 CallLocator ,
@@ -391,17 +393,17 @@ def _to_generated(self):
391393class MediaStreamingOptions :
392394 """Configuration of Media streaming.
393395
394- :param transport_url: Transport URL for media streaming.
395- :type transport_url: str
396- :param transport_type: The type of transport to be used for media streaming.
397- :type transport_type: str or ~azure.communication.callautomation.MediaStreamingTransportType
398- :param content_type: Content type to stream, eg. audio, audio/video.
399- :type content_type: str or ~azure.communication.callautomation.MediaStreamingContentType
400- :param audio_channel_type: Audio channel type to stream, eg. unmixed audio, mixed audio.
401- :type audio_channel_type: str or ~azure.communication.callautomation.MediaStreamingAudioChannelType
402- :param start_media_streaming: Determines if the media streaming should be started immediately
396+ :keyword transport_url: Transport URL for media streaming.
397+ :paramtype transport_url: str
398+ :keyword transport_type: The type of transport to be used for media streaming.
399+ :paramtype transport_type: str or ~azure.communication.callautomation.MediaStreamingTransportType
400+ :keyword content_type: Content type to stream, eg. audio, audio/video.
401+ :paramtype content_type: str or ~azure.communication.callautomation.MediaStreamingContentType
402+ :keyword audio_channel_type: Audio channel type to stream, eg. unmixed audio, mixed audio.
403+ :paramtype audio_channel_type: str or ~azure.communication.callautomation.MediaStreamingAudioChannelType
404+ :keyword start_media_streaming: Determines if the media streaming should be started immediately
403405 after call is answered or not. Required.
404- :type start_media_streaming: bool
406+ :paramtype start_media_streaming: bool
405407 """
406408
407409 transport_url : str
@@ -418,6 +420,7 @@ class MediaStreamingOptions:
418420
419421 def __init__ (
420422 self ,
423+ * ,
421424 transport_url : str ,
422425 transport_type : Union [str , 'MediaStreamingTransportType' ],
423426 content_type : Union [str , 'MediaStreamingContentType' ],
@@ -442,20 +445,20 @@ def _to_generated(self):
442445class TranscriptionOptions :
443446 """Configuration of live transcription.
444447
445- :param transport_url: Transport URL for live transcription. Required.
446- :type transport_url: str
447- :param transport_type: The type of transport to be used for live transcription, eg. Websocket.
448+ :keyword transport_url: Transport URL for live transcription. Required.
449+ :paramtype transport_url: str
450+ :keyword transport_type: The type of transport to be used for live transcription, eg. Websocket.
448451 Required. "websocket"
449- :type transport_type: str or ~azure.communication.callautomation.TranscriptionTransportType
450- :param locale: Defines the locale for the data e.g en-CA, en-AU. Required.
451- :type locale: str
452- :param speech_recognition_model_endpoint_id: Endpoint where the custom model was deployed.
453- :type speech_recognition_model_endpoint_id: str
454- :param start_transcription: Determines if the transcription should be started immediately after
452+ :paramtype transport_type: str or ~azure.communication.callautomation.TranscriptionTransportType
453+ :keyword locale: Defines the locale for the data e.g en-CA, en-AU. Required.
454+ :paramtype locale: str
455+ :keyword speech_recognition_model_endpoint_id: Endpoint where the custom model was deployed.
456+ :paramtype speech_recognition_model_endpoint_id: str
457+ :keyword start_transcription: Determines if the transcription should be started immediately after
455458 call is answered or not. Required.
456- :type start_transcription: bool
457- :param enable_intermediate_results: Enables intermediate results for the transcribed speech.
458- :type enable_intermediate_results: bool
459+ :paramtype start_transcription: bool
460+ :keyword enable_intermediate_results: Enables intermediate results for the transcribed speech.
461+ :paramtype enable_intermediate_results: bool
459462 """
460463
461464 transport_url : str
@@ -473,6 +476,7 @@ class TranscriptionOptions:
473476
474477 def __init__ (
475478 self ,
479+ * ,
476480 transport_url : str ,
477481 transport_type : Union [str , 'TranscriptionTransportType' ],
478482 locale : str ,
@@ -938,3 +942,114 @@ def _from_generated(cls, cancel_add_participant_operation_result_generated: 'Can
938942 invitation_id = cancel_add_participant_operation_result_generated .invitation_id ,
939943 operation_context = cancel_add_participant_operation_result_generated .operation_context
940944 )
945+
946+ class ResultStatus (Enum ):
947+ """
948+ The status of the result of transcription.
949+ """
950+ INTERMEDIATE = "intermediate"
951+ FINAL = "final"
952+
953+ class TextFormat (Enum ):
954+ """
955+ The format of transcription text.
956+ """
957+ DISPLAY = "display"
958+
959+ class WordData :
960+ """
961+ Text in the phrase.
962+ :keyword text: Text in the phrase.
963+ :paramtype text: str
964+ :keyword offset: The word's position within the phrase.
965+ :paramtype offset: int
966+ :keyword duration: Duration in ticks. 1 tick = 100 nanoseconds.
967+ :paramtype duration: int
968+ """
969+ text :str
970+ """ Text in the phrase. """
971+ offset :int
972+ """ The word's position within the phrase. """
973+ duration :int
974+ """ Duration in ticks. 1 tick = 100 nanoseconds. """
975+
976+ def __init__ (self , text : str , offset : int , duration : int ):
977+ self .text = text
978+ self .offset = offset
979+ self .duration = duration
980+
981+ class TranscriptionMetadata :
982+ """
983+ Metadata for Transcription Streaming.
984+ :keyword subscription_id: Transcription Subscription Id.
985+ :paramtype subscription_id: str
986+ :keyword locale: The target locale in which the translated text needs to be.
987+ :paramtype locale: str
988+ :keyword callConnection_id: call connection Id.
989+ :paramtype callConnection_id: str
990+ :keyword correlation_id: correlation Id.
991+ :paramtype correlation_id: str
992+ """
993+
994+ subscription_id : str
995+ """ Transcription Subscription Id. """
996+ locale : str
997+ """ The target locale in which the translated text needs to be. """
998+ callConnection_id : str
999+ """ call connection Id. """
1000+ correlation_id : str
1001+ """ correlation Id. """
1002+
1003+ def __init__ (self , subscription_id : str , locale : str , callConnection_id : str , correlation_id : str ):
1004+ self .subscriptionId = subscription_id
1005+ self .locale = locale
1006+ self .callConnection_id = callConnection_id
1007+ self .correlation_id = correlation_id
1008+
1009+ class TranscriptionData :
1010+ """
1011+ Streaming Transcription.
1012+ :keyword text: The display form of the recognized word.
1013+ :paramtype text: str
1014+ :keyword format: The format of text.
1015+ :paramtype format: TextFormat
1016+ :keyword confidence: Confidence of recognition of the whole phrase.
1017+ :paramtype confidence: float
1018+ :keyword offset: The position of this payload.
1019+ :paramtype offset: int
1020+ :keyword duration: Duration in ticks. 1 tick = 100 nanoseconds.
1021+ :paramtype duration: int
1022+ :keyword words: The result for each word of the phrase.
1023+ :paramtype words: List[WordData]
1024+ :keyword participant: The identified speaker based on participant raw ID.
1025+ :paramtype participant: CommunicationIdentifier
1026+ :keyword resultStatus: Status of the result of transcription.
1027+ :paramtype resultStatus: ResultStatus
1028+ """
1029+ text : str
1030+ """ The display form of the recognized word. """
1031+ format : TextFormat
1032+ """ The format of text. """
1033+ confidence : float
1034+ """ Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence). """
1035+ offset : int
1036+ """ The position of this payload. """
1037+ duration : int
1038+ """ Duration in ticks. 1 tick = 100 nanoseconds. """
1039+ words : List [WordData ]
1040+ """ The result for each word of the phrase. """
1041+ participant : CommunicationIdentifier
1042+ """ The identified speaker based on participant raw ID. """
1043+ result_status : ResultStatus
1044+ """ Status of the result of transcription. """
1045+
1046+ def __init__ (self , text : str , format : TextFormat , confidence : float , offset : int , duration : int ,
1047+ words : List [WordData ], participant : CommunicationIdentifier , result_status : ResultStatus ):
1048+ self .text = text
1049+ self .format = format
1050+ self .confidence = confidence
1051+ self .offset = offset
1052+ self .duration = duration
1053+ self .words = words
1054+ self .participant = participant
1055+ self .result_status = result_status
0 commit comments