tencentcloud-sdk-python-intl-en 3.0.1095__py2.py3-none-any.whl → 3.0.1097__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.
Potentially problematic release.
This version of tencentcloud-sdk-python-intl-en might be problematic. Click here for more details.
- tencentcloud/__init__.py +1 -1
- tencentcloud/asr/__init__.py +0 -0
- tencentcloud/asr/v20190614/__init__.py +0 -0
- tencentcloud/asr/v20190614/asr_client.py +87 -0
- tencentcloud/asr/v20190614/errorcodes.py +66 -0
- tencentcloud/asr/v20190614/models.py +1293 -0
- tencentcloud/mps/v20190612/errorcodes.py +2 -173
- tencentcloud/mps/v20190612/models.py +939 -145
- tencentcloud/mps/v20190612/mps_client.py +25 -0
- tencentcloud/redis/v20180412/models.py +2 -2
- {tencentcloud_sdk_python_intl_en-3.0.1095.dist-info → tencentcloud_sdk_python_intl_en-3.0.1097.dist-info}/METADATA +1 -1
- {tencentcloud_sdk_python_intl_en-3.0.1095.dist-info → tencentcloud_sdk_python_intl_en-3.0.1097.dist-info}/RECORD +14 -9
- {tencentcloud_sdk_python_intl_en-3.0.1095.dist-info → tencentcloud_sdk_python_intl_en-3.0.1097.dist-info}/WHEEL +0 -0
- {tencentcloud_sdk_python_intl_en-3.0.1095.dist-info → tencentcloud_sdk_python_intl_en-3.0.1097.dist-info}/top_level.txt +0 -0
tencentcloud/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# -*- coding: utf8 -*-
|
|
2
|
+
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
import json
|
|
17
|
+
|
|
18
|
+
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
|
19
|
+
from tencentcloud.common.abstract_client import AbstractClient
|
|
20
|
+
from tencentcloud.asr.v20190614 import models
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class AsrClient(AbstractClient):
|
|
24
|
+
_apiVersion = '2019-06-14'
|
|
25
|
+
_endpoint = 'asr.tencentcloudapi.com'
|
|
26
|
+
_service = 'asr'
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def CreateRecTask(self, request):
|
|
30
|
+
"""This API can be used to recognize audio content with a long duration in recording files. If you want to use ASR with UI, visit [the trial console] (https://console.cloud.tencent.com/asr/demonstrate). For product pricing, see [Billing Overview (Online Version)] (https://intl.cloud.tencent.com/document/product/1093/35686?from_cn_redirect=1)
|
|
31
|
+
- Default frequency limit: 20 requests/second. This limit only applies to submitted requests but not the response time.
|
|
32
|
+
Response time: The API adopts asynchronous callback and does not return results in real time. Recognition results will be returned within 3 hours at most. ** In most cases, audio with a duration of 1 hour can be recognized in 1 to 3 minutes. ** Note: The response time does not include the audio download time and will not apply to scenarios where recordings with a total audio duration of over 1,000 hours or over 20,000 requests are submitted within 30 minutes.
|
|
33
|
+
- Audio formats: WAV, MP3, M4A, FLV, MP4, WMA, 3GP, AMR, AAC, OGG (Opus), and FLAC.
|
|
34
|
+
- Supported languages: See the description of ** EngineModelType ** in this document or go to [Product Features] (https://intl.cloud.tencent.com/document/product/1093/35682?from_cn_redirect=1) for details.
|
|
35
|
+
- Audio submission method: This API supports ** audio URLs and local audio files **. It is recommended to use [Tencent Cloud COS] (https://intl.cloud.tencent.com/document/product/436/38484?from_cn_redirect=1) to store audio files, generate URLs, and submit requests. This method does not incur public network or downstream traffic fees but can speed up task processing. (Set the public read and private write permissions for COS buckets or URLs to be externally accessible.)
|
|
36
|
+
- Audio restrictions: For a single URL, the audio duration cannot exceed 5 hours, and the file size cannot exceed 1 GB. For a local audio file, the file size cannot exceed 5 MB.
|
|
37
|
+
- Obtain recognition results: Results can be obtained through ** callback or polling **. See [Result Query] (https://intl.cloud.tencent.com/document/product/1093/37822?from_cn_redirect=1) for details.
|
|
38
|
+
- Recognition result retention period: Recognition results are retained on the server for 24 hours.
|
|
39
|
+
- For the signature method, see the content related to the signature method v3 in [Public Parameters] (https://intl.cloud.tencent.com/document/api/1093/35640?from_cn_redirect=1).
|
|
40
|
+
|
|
41
|
+
:param request: Request instance for CreateRecTask.
|
|
42
|
+
:type request: :class:`tencentcloud.asr.v20190614.models.CreateRecTaskRequest`
|
|
43
|
+
:rtype: :class:`tencentcloud.asr.v20190614.models.CreateRecTaskResponse`
|
|
44
|
+
|
|
45
|
+
"""
|
|
46
|
+
try:
|
|
47
|
+
params = request._serialize()
|
|
48
|
+
headers = request.headers
|
|
49
|
+
body = self.call("CreateRecTask", params, headers=headers)
|
|
50
|
+
response = json.loads(body)
|
|
51
|
+
model = models.CreateRecTaskResponse()
|
|
52
|
+
model._deserialize(response["Response"])
|
|
53
|
+
return model
|
|
54
|
+
except Exception as e:
|
|
55
|
+
if isinstance(e, TencentCloudSDKException):
|
|
56
|
+
raise
|
|
57
|
+
else:
|
|
58
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def DescribeTaskStatus(self, request):
|
|
62
|
+
"""The recognition results can be obtained through callback or polling after the recording recognition request API is called.
|
|
63
|
+
- ** Note: A task is valid for 24 hours. Do not query the results with tasks that have existed for more than 24 hours or use task ID as the unique business ID because duplicate TaskIds of different dates may exist. **
|
|
64
|
+
- For the callback method, the results will be sent by using a POST request to the callback URL specified in the request after the recognition is completed. For more details, see [Callback Description] (https://intl.cloud.tencent.com/document/product/1093/52632?from_cn_redirect=1).
|
|
65
|
+
- For the polling method, you need to actively provide the task ID to poll for recognition results. There are four possible results: success, waiting, in progress, and failure. For detailed information, see the content below.
|
|
66
|
+
- The request method is HTTP POST, and Content-Type is "application/json; charset=utf-8".
|
|
67
|
+
- For the signature method, see the content related to the signature method v3 in [Public Parameters](https://intl.cloud.tencent.com/document/api/1093/35640?from_cn_redirect=1).
|
|
68
|
+
- Default request frequency limit: 50 requests/second. If you want to increase the request frequency limit, submit a [ticket](https://console.cloud.tencent.com/workorder/category).
|
|
69
|
+
|
|
70
|
+
:param request: Request instance for DescribeTaskStatus.
|
|
71
|
+
:type request: :class:`tencentcloud.asr.v20190614.models.DescribeTaskStatusRequest`
|
|
72
|
+
:rtype: :class:`tencentcloud.asr.v20190614.models.DescribeTaskStatusResponse`
|
|
73
|
+
|
|
74
|
+
"""
|
|
75
|
+
try:
|
|
76
|
+
params = request._serialize()
|
|
77
|
+
headers = request.headers
|
|
78
|
+
body = self.call("DescribeTaskStatus", params, headers=headers)
|
|
79
|
+
response = json.loads(body)
|
|
80
|
+
model = models.DescribeTaskStatusResponse()
|
|
81
|
+
model._deserialize(response["Response"])
|
|
82
|
+
return model
|
|
83
|
+
except Exception as e:
|
|
84
|
+
if isinstance(e, TencentCloudSDKException):
|
|
85
|
+
raise
|
|
86
|
+
else:
|
|
87
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# -*- coding: utf8 -*-
|
|
2
|
+
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Authentication error occurred.
|
|
18
|
+
AUTHFAILURE_INVALIDAUTHORIZATION = 'AuthFailure.InvalidAuthorization'
|
|
19
|
+
|
|
20
|
+
# Authentication error occurred.
|
|
21
|
+
FAILEDOPERATION_CHECKAUTHINFOFAILED = 'FailedOperation.CheckAuthInfoFailed'
|
|
22
|
+
|
|
23
|
+
# Failed to download the audio file.
|
|
24
|
+
FAILEDOPERATION_ERRORDOWNFILE = 'FailedOperation.ErrorDownFile'
|
|
25
|
+
|
|
26
|
+
# Recognition failed.
|
|
27
|
+
FAILEDOPERATION_ERRORRECOGNIZE = 'FailedOperation.ErrorRecognize'
|
|
28
|
+
|
|
29
|
+
# Incorrect task ID.
|
|
30
|
+
FAILEDOPERATION_NOSUCHTASK = 'FailedOperation.NoSuchTask'
|
|
31
|
+
|
|
32
|
+
# Services are stopped due to overdue payments. Top up your Tencent Cloud account first.
|
|
33
|
+
FAILEDOPERATION_SERVICEISOLATE = 'FailedOperation.ServiceIsolate'
|
|
34
|
+
|
|
35
|
+
# The resource package is used up. Purchase a new one or enable post-payment.
|
|
36
|
+
FAILEDOPERATION_USERHASNOAMOUNT = 'FailedOperation.UserHasNoAmount'
|
|
37
|
+
|
|
38
|
+
# The resource package is used up. Enable post-payment or purchase a new resource package.
|
|
39
|
+
FAILEDOPERATION_USERHASNOFREEAMOUNT = 'FailedOperation.UserHasNoFreeAmount'
|
|
40
|
+
|
|
41
|
+
# The service is not enabled. Enable it in the Tencent Cloud ASR console.
|
|
42
|
+
FAILEDOPERATION_USERNOTREGISTERED = 'FailedOperation.UserNotRegistered'
|
|
43
|
+
|
|
44
|
+
# Failed to download the audio file.
|
|
45
|
+
INTERNALERROR_ERRORDOWNFILE = 'InternalError.ErrorDownFile'
|
|
46
|
+
|
|
47
|
+
# Failed to access the database.
|
|
48
|
+
INTERNALERROR_FAILACCESSDATABASE = 'InternalError.FailAccessDatabase'
|
|
49
|
+
|
|
50
|
+
# Failed to access Redis.
|
|
51
|
+
INTERNALERROR_FAILACCESSREDIS = 'InternalError.FailAccessRedis'
|
|
52
|
+
|
|
53
|
+
# Parameter error.
|
|
54
|
+
INVALIDPARAMETER = 'InvalidParameter'
|
|
55
|
+
|
|
56
|
+
# Invalid parameter value.
|
|
57
|
+
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
|
|
58
|
+
|
|
59
|
+
# Parameters are missing
|
|
60
|
+
MISSINGPARAMETER = 'MissingParameter'
|
|
61
|
+
|
|
62
|
+
# Requests are sent too frequently.
|
|
63
|
+
REQUESTLIMITEXCEEDED_UINLIMITEXCEEDED = 'RequestLimitExceeded.UinLimitExceeded'
|
|
64
|
+
|
|
65
|
+
# Unknown parameter.
|
|
66
|
+
UNKNOWNPARAMETER = 'UnknownParameter'
|