tencentcloud-sdk-python 3.0.1158__py2.py3-none-any.whl → 3.0.1160__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1051,10 +1051,19 @@ class DescribeAITranscriptionRequest(AbstractModel):
1051
1051
 
1052
1052
  def __init__(self):
1053
1053
  r"""
1054
- :param _TaskId: 唯一标识AI转录任务。
1054
+ :param _TaskId: 查询任务状态,不使用时传入空字符串。
1055
+ 有两种查询方式:
1056
+ 1、只填写TaskId,这种方式使用TaskId来查询任务
1057
+ 2、TaskId为空字符串,填写SdkAppId和SessionId,这种方式不需要使用TaskId查询任务
1055
1058
  :type TaskId: str
1059
+ :param _SdkAppId: TRTC的SdkAppId,和SessionId配合使用。
1060
+ :type SdkAppId: int
1061
+ :param _SessionId: 开启转录任务时传入的SessionId,和SdkAppId配合使用。
1062
+ :type SessionId: str
1056
1063
  """
1057
1064
  self._TaskId = None
1065
+ self._SdkAppId = None
1066
+ self._SessionId = None
1058
1067
 
1059
1068
  @property
1060
1069
  def TaskId(self):
@@ -1064,9 +1073,27 @@ class DescribeAITranscriptionRequest(AbstractModel):
1064
1073
  def TaskId(self, TaskId):
1065
1074
  self._TaskId = TaskId
1066
1075
 
1076
+ @property
1077
+ def SdkAppId(self):
1078
+ return self._SdkAppId
1079
+
1080
+ @SdkAppId.setter
1081
+ def SdkAppId(self, SdkAppId):
1082
+ self._SdkAppId = SdkAppId
1083
+
1084
+ @property
1085
+ def SessionId(self):
1086
+ return self._SessionId
1087
+
1088
+ @SessionId.setter
1089
+ def SessionId(self, SessionId):
1090
+ self._SessionId = SessionId
1091
+
1067
1092
 
1068
1093
  def _deserialize(self, params):
1069
1094
  self._TaskId = params.get("TaskId")
1095
+ self._SdkAppId = params.get("SdkAppId")
1096
+ self._SessionId = params.get("SessionId")
1070
1097
  memeber_set = set(params.keys())
1071
1098
  for name, value in vars(self).items():
1072
1099
  property_name = name[1:]
@@ -1084,15 +1111,26 @@ class DescribeAITranscriptionResponse(AbstractModel):
1084
1111
 
1085
1112
  def __init__(self):
1086
1113
  r"""
1087
- :param _StartTime: 起始时间。
1114
+ :param _StartTime: 任务开始时间。
1088
1115
  :type StartTime: str
1089
1116
  :param _Status: 转录任务状态。
1117
+ 有4个值:
1118
+ 1、Idle表示任务未开始
1119
+ 2、Preparing表示任务准备中
1120
+ 3、InProgress表示任务正在运行
1121
+ 4、Stopped表示任务已停止,正在清理资源中
1090
1122
  :type Status: str
1123
+ :param _TaskId: 唯一标识一次任务。
1124
+ :type TaskId: str
1125
+ :param _SessionId: 开启转录任务时填写的SessionId,如果没写则不返回。
1126
+ :type SessionId: str
1091
1127
  :param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
1092
1128
  :type RequestId: str
1093
1129
  """
1094
1130
  self._StartTime = None
1095
1131
  self._Status = None
1132
+ self._TaskId = None
1133
+ self._SessionId = None
1096
1134
  self._RequestId = None
1097
1135
 
1098
1136
  @property
@@ -1111,6 +1149,22 @@ class DescribeAITranscriptionResponse(AbstractModel):
1111
1149
  def Status(self, Status):
1112
1150
  self._Status = Status
1113
1151
 
1152
+ @property
1153
+ def TaskId(self):
1154
+ return self._TaskId
1155
+
1156
+ @TaskId.setter
1157
+ def TaskId(self, TaskId):
1158
+ self._TaskId = TaskId
1159
+
1160
+ @property
1161
+ def SessionId(self):
1162
+ return self._SessionId
1163
+
1164
+ @SessionId.setter
1165
+ def SessionId(self, SessionId):
1166
+ self._SessionId = SessionId
1167
+
1114
1168
  @property
1115
1169
  def RequestId(self):
1116
1170
  return self._RequestId
@@ -1123,6 +1177,8 @@ class DescribeAITranscriptionResponse(AbstractModel):
1123
1177
  def _deserialize(self, params):
1124
1178
  self._StartTime = params.get("StartTime")
1125
1179
  self._Status = params.get("Status")
1180
+ self._TaskId = params.get("TaskId")
1181
+ self._SessionId = params.get("SessionId")
1126
1182
  self._RequestId = params.get("RequestId")
1127
1183
 
1128
1184
 
@@ -7173,26 +7229,82 @@ class RecognizeConfig(AbstractModel):
7173
7229
 
7174
7230
  def __init__(self):
7175
7231
  r"""
7176
- :param _Language: 支持的语言,目前支持语言如下:
7177
- Chinese = "zh"
7178
- Chinese_TW = "zh-TW"
7179
- English = "en"
7180
- Vietnamese = "vi"
7181
- Japanese = "ja"
7182
- Korean = "ko"
7183
- Indonesia = "id"
7184
- Thai = "th"
7185
- Portuguese = "pt"
7186
- Turkish = "tr"
7187
- Arabic = "ar"
7188
- Spanish = "es"
7189
- Hindi = "hi"
7190
- French = "fr"
7232
+ :param _Language: 语音识别支持的语言,默认是"zh"。目前全量支持的语言如下,等号左面是语言英文名,右面是Language字段需要填写的值,该值遵循[ISO639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes):
7233
+ Chinese = "zh"
7234
+ Chinese_TW = "zh-TW"
7235
+ English = "en"
7236
+ Vietnamese = "vi"
7237
+ Japanese = "ja"
7238
+ Korean = "ko"
7239
+ Indonesia = "id"
7240
+ Thai = "th"
7241
+ Portuguese = "pt"
7242
+ Turkish = "tr"
7243
+ Arabic = "ar"
7244
+ Spanish = "es"
7245
+ Hindi = "hi"
7246
+ French = "fr"
7247
+ Malay = "ms"
7248
+ Filipino = "fil"
7249
+ German = "de"
7250
+ Italian = "it"
7251
+ Russian = "ru"
7252
+
7253
+ 注意:
7254
+ 如果缺少满足您需求的语言,请联系我们技术人员。
7255
+ tencent asr不支持"it"和"ru",google asr全都支持。
7191
7256
  :type Language: str
7192
- :param _TranslationLanguage: 选填,如果填写,则会启用翻译,不填则忽略。支持语言同Language字段。
7257
+ :param _Model: 使用的模型,目前支持tencent和google,默认是tencent。
7258
+ :type Model: str
7259
+ :param _TranslationLanguage: 翻译功能支持的语言,如果填写,则会启用翻译,不填则只会使用语音识别。
7260
+ 目前全量支持的语言如下,等号左面是语言英文名,右面是Language字段需要填写的值,该值遵循[ISO639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes):
7261
+ Chinese = "zh"
7262
+ Chinese_TW = "zh-TW"
7263
+ English = "en"
7264
+ Vietnamese = "vi"
7265
+ Japanese = "ja"
7266
+ Korean = "ko"
7267
+ Indonesia = "id"
7268
+ Thai = "th"
7269
+ Portuguese = "pt"
7270
+ Turkish = "tr"
7271
+ Arabic = "ar"
7272
+ Spanish = "es"
7273
+ Hindi = "hi"
7274
+ French = "fr"
7275
+ Malay = "ms"
7276
+ Filipino = "fil"
7277
+ German = "de"
7278
+ Italian = "it"
7279
+ Russian = "ru"
7280
+
7281
+ 注意:
7282
+ 如果缺少满足您需求的语言,请联系我们技术人员。
7283
+ google支持上述语言两两之间翻译,tencent只支持部分语言之间翻译。
7284
+
7285
+ tencnet目标语言,各源语言的目标语言支持列表如下,冒号左侧是目标语言,右侧是源语言:
7286
+ - zh(简体中文):zh-TW(繁体中文)、en(英语)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)
7287
+ - zh-TW(繁体中文):zh(简体中文)、en(英语)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)
7288
+ - en(英语):zh(中文)、zh-TW(繁体中文)、ja(日语)、ko(韩语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)、vi(越南语)、id(印尼语)、th(泰语)、ms(马来语)、ar(阿拉伯语)、hi(印地语)
7289
+ - ja(日语):zh(中文)、zh-TW(繁体中文)、en(英语)、ko(韩语)
7290
+ - ko(韩语):zh(中文)、zh-TW(繁体中文)、en(英语)、ja(日语)
7291
+ - fr(法语):zh(中文)、zh-TW(繁体中文)、en(英语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)
7292
+ - es(西班牙语):zh(中文)、zh-TW(繁体中文)、en(英语)、fr(法语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)
7293
+ - it(意大利语):zh(中文)、zh-TW(繁体中文)、en(英语)、fr(法语)、es(西班牙语)、de(德语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)
7294
+ - de(德语):zh(中文)、zh-TW(繁体中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、tr(土耳其语)、ru(俄语)、pt(葡萄牙语)
7295
+ - tr(土耳其语):zh(中文)、zh-TW(繁体中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、ru(俄语)、pt(葡萄牙语)
7296
+ - ru(俄语):zh(中文)、zh-TW(繁体中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、pt(葡萄牙语)
7297
+ - pt(葡萄牙语):zh(中文)、zh-TW(繁体中文)、en(英语)、fr(法语)、es(西班牙语)、it(意大利语)、de(德语)、tr(土耳其语)、ru(俄语)
7298
+ - vi(越南语):zh(中文)、zh-TW(繁体中文)、en(英语)
7299
+ - id(印尼语):zh(中文)、zh-TW(繁体中文)、en(英语)
7300
+ - th(泰语):zh(中文)、zh-TW(繁体中文)、en(英语)
7301
+ - ms(马来语):zh(中文)、zh-TW(繁体中文)、en(英语)
7302
+ - ar(阿拉伯语):en(英语)
7303
+ - hi(印地语):en(英语)
7193
7304
  :type TranslationLanguage: str
7194
7305
  """
7195
7306
  self._Language = None
7307
+ self._Model = None
7196
7308
  self._TranslationLanguage = None
7197
7309
 
7198
7310
  @property
@@ -7203,6 +7315,14 @@ class RecognizeConfig(AbstractModel):
7203
7315
  def Language(self, Language):
7204
7316
  self._Language = Language
7205
7317
 
7318
+ @property
7319
+ def Model(self):
7320
+ return self._Model
7321
+
7322
+ @Model.setter
7323
+ def Model(self, Model):
7324
+ self._Model = Model
7325
+
7206
7326
  @property
7207
7327
  def TranslationLanguage(self):
7208
7328
  return self._TranslationLanguage
@@ -7214,6 +7334,7 @@ class RecognizeConfig(AbstractModel):
7214
7334
 
7215
7335
  def _deserialize(self, params):
7216
7336
  self._Language = params.get("Language")
7337
+ self._Model = params.get("Model")
7217
7338
  self._TranslationLanguage = params.get("TranslationLanguage")
7218
7339
  memeber_set = set(params.keys())
7219
7340
  for name, value in vars(self).items():
@@ -8186,20 +8307,28 @@ class StartAITranscriptionRequest(AbstractModel):
8186
8307
 
8187
8308
  def __init__(self):
8188
8309
  r"""
8189
- :param _SdkAppId: TRTC的[SdkAppId](https://cloud.tencent.com/document/product/647/46351#sdkappid),使用该sdkappid开启任务。
8310
+ :param _SdkAppId: TRTC的[SdkAppId](https://cloud.tencent.com/document/product/647/46351#sdkappid),和开启转录任务的房间使用的SdkAppId相同。
8190
8311
  :type SdkAppId: int
8191
- :param _RoomId: TRTC的[RoomId](https://cloud.tencent.com/document/product/647/46351#roomid),使用该roomid开启任务。
8312
+ :param _RoomId: TRTC的[RoomId](https://cloud.tencent.com/document/product/647/46351#roomid),表示开启转录任务的房间号。
8192
8313
  :type RoomId: str
8193
- :param _TranscriptionParams: 启动转录机器人和鉴权的参数。
8314
+ :param _TranscriptionParams: 转录机器人的参数。
8194
8315
  :type TranscriptionParams: :class:`tencentcloud.trtc.v20190722.models.TranscriptionParams`
8316
+ :param _SessionId: 调用方传入的唯一Id,服务端用来去重。
8317
+ 注意:
8318
+ 如果传入该参数,服务端优先使用该参数来去重。
8319
+ 如果不传该参数,服务端的去重策略如下:
8320
+ - 如果TranscriptionMode字段是0,则一个房间只能开启一个任务
8321
+ - 如果TranscriptionMode字段是1,则一个TargetUserId只能开启一个任务
8322
+ :type SessionId: str
8195
8323
  :param _RoomIdType: TRTC房间号的类型,0代表数字房间号,1代表字符串房间号。不填默认是数字房间号。
8196
8324
  :type RoomIdType: int
8197
- :param _RecognizeConfig: 语音识别配置
8325
+ :param _RecognizeConfig: 语音识别配置。
8198
8326
  :type RecognizeConfig: :class:`tencentcloud.trtc.v20190722.models.RecognizeConfig`
8199
8327
  """
8200
8328
  self._SdkAppId = None
8201
8329
  self._RoomId = None
8202
8330
  self._TranscriptionParams = None
8331
+ self._SessionId = None
8203
8332
  self._RoomIdType = None
8204
8333
  self._RecognizeConfig = None
8205
8334
 
@@ -8227,6 +8356,14 @@ class StartAITranscriptionRequest(AbstractModel):
8227
8356
  def TranscriptionParams(self, TranscriptionParams):
8228
8357
  self._TranscriptionParams = TranscriptionParams
8229
8358
 
8359
+ @property
8360
+ def SessionId(self):
8361
+ return self._SessionId
8362
+
8363
+ @SessionId.setter
8364
+ def SessionId(self, SessionId):
8365
+ self._SessionId = SessionId
8366
+
8230
8367
  @property
8231
8368
  def RoomIdType(self):
8232
8369
  return self._RoomIdType
@@ -8250,6 +8387,7 @@ class StartAITranscriptionRequest(AbstractModel):
8250
8387
  if params.get("TranscriptionParams") is not None:
8251
8388
  self._TranscriptionParams = TranscriptionParams()
8252
8389
  self._TranscriptionParams._deserialize(params.get("TranscriptionParams"))
8390
+ self._SessionId = params.get("SessionId")
8253
8391
  self._RoomIdType = params.get("RoomIdType")
8254
8392
  if params.get("RecognizeConfig") is not None:
8255
8393
  self._RecognizeConfig = RecognizeConfig()
@@ -130,7 +130,7 @@ class TrtcClient(AbstractClient):
130
130
 
131
131
 
132
132
  def DescribeAITranscription(self, request):
133
- """查询AI转录状态
133
+ """查询AI转录任务状态。
134
134
 
135
135
  :param request: Request instance for DescribeAITranscription.
136
136
  :type request: :class:`tencentcloud.trtc.v20190722.models.DescribeAITranscriptionRequest`
@@ -969,7 +969,50 @@ class TrtcClient(AbstractClient):
969
969
 
970
970
 
971
971
  def StartAITranscription(self, request):
972
- """这个接口调用后,后台会启动机器人,实时进行语音识别并下发字幕和会议记录。
972
+ """这个接口调用后,后台会启动转录机器人,实时进行语音识别并下发字幕和转录消息。
973
+ 转录机器人支持两种拉流方式,通过TranscriptionMode字段控制:
974
+ - 拉取全房间的流。
975
+ - 拉取特定用户的流。
976
+
977
+ 服务端实时下发字幕和会议记录有两种方式,通过IMAdminUserId和IMAdminUserSig字段控制:
978
+ - 如果填写IMAdminUserId和IMAdminUserSig,服务端会调用IM的[发送群组消息](https://cloud.tencent.com/document/product/269/1629)API来向端上实时下发消息。客户端只需监听群组消息的回调即可,比如[web端回调](https://cloud.tencent.com/document/product/269/75319)。
979
+ - 如果不填写IMAdminUserId和IMAdminUserSig,服务端使用TRTC自定义消息通道下发消息,CmdId固定是1。客户端只需监听自定义消息的回调即可,比如[c++回调](https://cloud.tencent.com/document/product/647/79637#4cd82f4edb24992a15a25187089e1565)。
980
+
981
+ 服务端实时下发的消息是JSON字符串,实时字幕具体格式如下:
982
+ `{
983
+ "type": "subtitle",
984
+ "userid": "xxx",
985
+ "text": "xxx",
986
+ "translation_text": "xxx",
987
+ "start_time": "00:00:02",
988
+ "end_time": "00:00:05"
989
+ }`
990
+ 字段作用如下:
991
+ - type是subtitle,表示这是实时字幕消息。
992
+ - userid表示是哪个用户说的话。
993
+ - text是语音识别出的文本。
994
+ - translation_text是text翻译后的文本,如果不启用翻译,则是空字符串。
995
+ - start_time和end_time表示该字幕消息从任务开启后的开始和结束时间。
996
+
997
+ 转录消息具体格式如下:
998
+ `{
999
+ "type": "transcription",
1000
+ "userid": "xxx",
1001
+ "text": "xxx",
1002
+ "translation_text": "xx",
1003
+ "start_time": "00:00:02",
1004
+ "end_time": "00:00:05"
1005
+ }`
1006
+ 字段作用如下:
1007
+ - type是transcription,表示这是转录消息。
1008
+ - 其余字段同实时字幕消息。
1009
+
1010
+ 转录消息和实时字幕消息的区别是,转录消息是完整的一句话,实时字幕消息则是这一句话的中间阶段。
1011
+ 假如有一句完整的话,“今天天气怎么样?”,那么服务的下发消息的顺序可能是这样:
1012
+ - 字幕消息,“今天”
1013
+ - 字幕消息,“今天天气”
1014
+ - 字幕消息,“今天天气怎么样”
1015
+ - 转录消息,“今天天气怎么样?”
973
1016
 
974
1017
  :param request: Request instance for StartAITranscription.
975
1018
  :type request: :class:`tencentcloud.trtc.v20190722.models.StartAITranscriptionRequest`
@@ -1245,7 +1288,7 @@ class TrtcClient(AbstractClient):
1245
1288
 
1246
1289
 
1247
1290
  def StopAITranscription(self, request):
1248
- """停止AI转录
1291
+ """停止AI转录任务。
1249
1292
 
1250
1293
  :param request: Request instance for StopAITranscription.
1251
1294
  :type request: :class:`tencentcloud.trtc.v20190722.models.StopAITranscriptionRequest`
@@ -1383,7 +1426,7 @@ class TrtcClient(AbstractClient):
1383
1426
 
1384
1427
 
1385
1428
  def SummarizeTranscription(self, request):
1386
- """对转录的文本进行总结
1429
+ """对转录的文本进行总结。
1387
1430
 
1388
1431
  :param request: Request instance for SummarizeTranscription.
1389
1432
  :type request: :class:`tencentcloud.trtc.v20190722.models.SummarizeTranscriptionRequest`