|
6 | 6 | # -------------------------------------------------------------------------- |
7 | 7 |
|
8 | 8 | from typing import List, Optional, Union, TYPE_CHECKING |
9 | | -from enum import Enum |
10 | | -from datetime import datetime |
11 | 9 | from typing_extensions import Literal |
12 | 10 | from ._generated.models import ( |
13 | 11 | CallLocator, |
@@ -966,188 +964,3 @@ def _from_generated(cls, cancel_add_participant_operation_result_generated: 'Can |
966 | 964 | invitation_id=cancel_add_participant_operation_result_generated.invitation_id, |
967 | 965 | operation_context=cancel_add_participant_operation_result_generated.operation_context |
968 | 966 | ) |
969 | | - |
970 | | -class TextFormat(Enum): |
971 | | - """ |
972 | | - The format of transcription text. |
973 | | - """ |
974 | | - DISPLAY = "display" |
975 | | - |
976 | | -class WordData: |
977 | | - """ |
978 | | - Text in the phrase. |
979 | | - :keyword text: Text in the phrase. |
980 | | - :paramtype text: str |
981 | | - :keyword offset: The word's position within the phrase. |
982 | | - :paramtype offset: int |
983 | | - :keyword duration: Duration in ticks. 1 tick = 100 nanoseconds. |
984 | | - :paramtype duration: int |
985 | | - """ |
986 | | - text:str |
987 | | - """ Text in the phrase. """ |
988 | | - offset:int |
989 | | - """ The word's position within the phrase. """ |
990 | | - duration:int |
991 | | - """ Duration in ticks. 1 tick = 100 nanoseconds. """ |
992 | | - |
993 | | - def __init__(self, text: str, offset: int, duration: int): |
994 | | - self.text = text |
995 | | - self.offset = offset |
996 | | - self.duration = duration |
997 | | - |
998 | | -class TranscriptionMetadata: |
999 | | - """ |
1000 | | - Metadata for Transcription Streaming. |
1001 | | - :keyword subscription_id: Transcription Subscription Id. |
1002 | | - :paramtype subscription_id: str |
1003 | | - :keyword locale: The target locale in which the translated text needs to be. |
1004 | | - :paramtype locale: str |
1005 | | - :keyword callConnection_id: call connection Id. |
1006 | | - :paramtype callConnection_id: str |
1007 | | - :keyword correlation_id: correlation Id. |
1008 | | - :paramtype correlation_id: str |
1009 | | - """ |
1010 | | - |
1011 | | - subscription_id: str |
1012 | | - """ Transcription Subscription Id. """ |
1013 | | - locale: str |
1014 | | - """ The target locale in which the translated text needs to be. """ |
1015 | | - call_connection_id: str |
1016 | | - """ call connection Id. """ |
1017 | | - correlation_id: str |
1018 | | - """ correlation Id. """ |
1019 | | - |
1020 | | - def __init__( |
1021 | | - self, |
1022 | | - *, |
1023 | | - subscription_id: str, |
1024 | | - locale: str, |
1025 | | - call_connection_id: str, |
1026 | | - correlation_id: str): |
1027 | | - self.subscription_id = subscription_id |
1028 | | - self.locale = locale |
1029 | | - self.call_connection_id = call_connection_id |
1030 | | - self.correlation_id = correlation_id |
1031 | | - |
1032 | | -class TranscriptionData: |
1033 | | - """ |
1034 | | - Streaming Transcription. |
1035 | | - :keyword text: The display form of the recognized word. |
1036 | | - :paramtype text: str |
1037 | | - :keyword format: The format of text. |
1038 | | - :paramtype format: TextFormat |
1039 | | - :keyword confidence: Confidence of recognition of the whole phrase. |
1040 | | - :paramtype confidence: float |
1041 | | - :keyword offset: The position of this payload. |
1042 | | - :paramtype offset: int |
1043 | | - :keyword duration: Duration in ticks. 1 tick = 100 nanoseconds. |
1044 | | - :paramtype duration: int |
1045 | | - :keyword words: The result for each word of the phrase. |
1046 | | - :paramtype words: List[WordData] |
1047 | | - :keyword participant: The identified speaker based on participant raw ID. |
1048 | | - :paramtype participant: CommunicationIdentifier |
1049 | | - :keyword result_state: Status of the result of transcription. |
1050 | | - :paramtype result_state: str or |
1051 | | - ~azure.communication.callautomation.models.TranscriptionResultState |
1052 | | - """ |
1053 | | - text: str |
1054 | | - """ The display form of the recognized word. """ |
1055 | | - format: TextFormat |
1056 | | - """ The format of text. """ |
1057 | | - confidence: float |
1058 | | - """ Confidence of recognition of the whole phrase, from 0.0 (no confidence) to 1.0 (full confidence). """ |
1059 | | - offset: int |
1060 | | - """ The position of this payload. """ |
1061 | | - duration: int |
1062 | | - """ Duration in ticks. 1 tick = 100 nanoseconds. """ |
1063 | | - words: List[WordData] |
1064 | | - """ The result for each word of the phrase. """ |
1065 | | - participant: CommunicationIdentifier |
1066 | | - """ The identified speaker based on participant raw ID. """ |
1067 | | - result_state: 'TranscriptionResultState' |
1068 | | - """ State of the result of transcription. """ |
1069 | | - |
1070 | | - def __init__( |
1071 | | - self, |
1072 | | - *, |
1073 | | - text: str, |
1074 | | - format: TextFormat, |
1075 | | - confidence: float, |
1076 | | - offset: int, |
1077 | | - duration: int, |
1078 | | - words: List[WordData], |
1079 | | - participant: CommunicationIdentifier, |
1080 | | - result_state: 'TranscriptionResultState'): |
1081 | | - self.text = text |
1082 | | - self.format = format |
1083 | | - self.confidence = confidence |
1084 | | - self.offset = offset |
1085 | | - self.duration = duration |
1086 | | - self.words = words |
1087 | | - self.participant = participant |
1088 | | - self.result_state = result_state |
1089 | | - |
1090 | | -class AudioMetadata: |
1091 | | - """ |
1092 | | - Metadata for Audio Streaming. |
1093 | | - :keyword subscription_id: Audio subscription id. |
1094 | | - :paramtype subscription_id: str |
1095 | | - :keyword encoding: Audio encoding. |
1096 | | - :paramtype encoding: str |
1097 | | - :keyword sample_rate: Audio sample rate. |
1098 | | - :paramtype sample_rate: int |
1099 | | - :keyword channels: Audio channels. |
1100 | | - :paramtype channels: int |
1101 | | - :keyword length: Audio length. |
1102 | | - :paramtype length: int |
1103 | | - """ |
1104 | | - subscription_id: str |
1105 | | - """ Audio subscription id. """ |
1106 | | - encoding: str |
1107 | | - """ Audio encoding. """ |
1108 | | - sample_rate: int |
1109 | | - """ Audio sample rate. """ |
1110 | | - channels: int |
1111 | | - """ Audio channels. """ |
1112 | | - length: int |
1113 | | - """ Audio length. """ |
1114 | | - |
1115 | | - def __init__( |
1116 | | - self, |
1117 | | - *, |
1118 | | - subscription_id: str, |
1119 | | - encoding: str, |
1120 | | - sample_rate: int, |
1121 | | - channels: int, |
1122 | | - length: int): |
1123 | | - self.subscription_id = subscription_id |
1124 | | - self.encoding = encoding |
1125 | | - self.sample_rate = sample_rate |
1126 | | - self.channels = channels |
1127 | | - self.length = length |
1128 | | - |
1129 | | -class AudioData: |
1130 | | - """ |
1131 | | - Data for Audio Streaming. |
1132 | | - :keyword data: Audio streaming data. |
1133 | | - :paramtype data: str |
1134 | | - :keyword time_stamp: time stamp. |
1135 | | - :paramtype time_stamp: datetime |
1136 | | - :keyword is_silent: Is silent. |
1137 | | - :paramtype is_silent: bool |
1138 | | - """ |
1139 | | - data: str |
1140 | | - """ Audio streaming data. """ |
1141 | | - time_stamp : datetime |
1142 | | - """ Time stamp. """ |
1143 | | - is_silent : bool |
1144 | | - """ Is silent. """ |
1145 | | - def __init__( |
1146 | | - self, |
1147 | | - *, |
1148 | | - data: str, |
1149 | | - time_stamp: str, |
1150 | | - is_silent: bool): |
1151 | | - self.data = data |
1152 | | - self.time_stamp = time_stamp |
1153 | | - self.is_silent = is_silent |
0 commit comments