tencentcloud-sdk-python-tmt 3.0.1478__tar.gz → 3.1.50__tar.gz
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.
- tencentcloud_sdk_python_tmt-3.1.50/PKG-INFO +46 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/setup.py +2 -1
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/__init__.py +1 -1
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/errorcodes.py +3 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/models.py +20 -64
- tencentcloud_sdk_python_tmt-3.1.50/tencentcloud/tmt/v20180321/tmt_client_async.py +183 -0
- tencentcloud_sdk_python_tmt-3.1.50/tencentcloud_sdk_python_tmt.egg-info/PKG-INFO +46 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud_sdk_python_tmt.egg-info/SOURCES.txt +1 -0
- tencentcloud_sdk_python_tmt-3.1.50/tencentcloud_sdk_python_tmt.egg-info/requires.txt +1 -0
- tencentcloud-sdk-python-tmt-3.0.1478/PKG-INFO +0 -45
- tencentcloud-sdk-python-tmt-3.0.1478/tencentcloud_sdk_python_tmt.egg-info/PKG-INFO +0 -45
- tencentcloud-sdk-python-tmt-3.0.1478/tencentcloud_sdk_python_tmt.egg-info/requires.txt +0 -1
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/README.rst +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/setup.cfg +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/__init__.py +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/__init__.py +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud/tmt/v20180321/tmt_client.py +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud_sdk_python_tmt.egg-info/dependency_links.txt +0 -0
- {tencentcloud-sdk-python-tmt-3.0.1478 → tencentcloud_sdk_python_tmt-3.1.50}/tencentcloud_sdk_python_tmt.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tencentcloud-sdk-python-tmt
|
|
3
|
+
Version: 3.1.50
|
|
4
|
+
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
+
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
+
Author: Tencent Cloud
|
|
7
|
+
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Platform: any
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.50
|
|
19
|
+
|
|
20
|
+
============================
|
|
21
|
+
Tencent Cloud SDK for Python
|
|
22
|
+
============================
|
|
23
|
+
|
|
24
|
+
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
25
|
+
The SDK works on Python versions:
|
|
26
|
+
|
|
27
|
+
* 2.7 and greater, including 3.x
|
|
28
|
+
|
|
29
|
+
Quick Start
|
|
30
|
+
-----------
|
|
31
|
+
|
|
32
|
+
First, install the library:
|
|
33
|
+
|
|
34
|
+
.. code-block:: sh
|
|
35
|
+
|
|
36
|
+
$ pip install tencentcloud-sdk-python-common
|
|
37
|
+
$ pip install tencentcloud-sdk-python-tmt
|
|
38
|
+
|
|
39
|
+
or download source code from github and install:
|
|
40
|
+
|
|
41
|
+
.. code-block:: sh
|
|
42
|
+
|
|
43
|
+
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
44
|
+
$ cd tencentcloud-sdk-python
|
|
45
|
+
$ python package.py --components common tmt
|
|
46
|
+
|
|
@@ -8,7 +8,8 @@ ROOT = os.path.dirname(__file__)
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name='tencentcloud-sdk-python-tmt',
|
|
11
|
-
install_requires=["tencentcloud-sdk-python-common>=3.
|
|
11
|
+
install_requires=["tencentcloud-sdk-python-common>=3.1.50,<4.0.0"],
|
|
12
|
+
|
|
12
13
|
version=tencentcloud.__version__,
|
|
13
14
|
description='Tencent Cloud Tmt SDK for Python',
|
|
14
15
|
long_description=open('README.rst').read(),
|
|
@@ -658,32 +658,11 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
658
658
|
|
|
659
659
|
def __init__(self):
|
|
660
660
|
r"""
|
|
661
|
-
:param _Data:
|
|
661
|
+
:param _Data: <p>图片数据的Base64字符串,经Base64编码后不超过 9M,分辨率建议600*800以上,支持PNG、JPG、JPEG格式。</p>
|
|
662
662
|
:type Data: str
|
|
663
|
-
:param _Target:
|
|
664
|
-
|
|
665
|
-
- 中文:zh
|
|
666
|
-
- 繁体(中国台湾):zh-TW
|
|
667
|
-
- 繁体(中国香港):zh-HK
|
|
668
|
-
- 英文:en
|
|
669
|
-
- 日语:ja
|
|
670
|
-
- 韩语:ko
|
|
671
|
-
- 泰语:th
|
|
672
|
-
- 越南语:vi
|
|
673
|
-
- 俄语:ru
|
|
674
|
-
- 德语:de
|
|
675
|
-
- 法语:fr
|
|
676
|
-
- 阿拉伯语:ar
|
|
677
|
-
- 西班牙语:es
|
|
678
|
-
- 意大利语:it
|
|
679
|
-
- 印度尼西亚语:id
|
|
680
|
-
- 马来西亚语:ms
|
|
681
|
-
- 葡萄牙语:pt
|
|
682
|
-
- 土耳其语:tr
|
|
683
|
-
-
|
|
663
|
+
:param _Target: <p>目标语言,支持语言列表:</p><ul><li>中文:zh</li><li>繁体(中国台湾):zh-TW</li><li>繁体(中国香港):zh-HK</li><li>英文:en</li><li>日语:ja</li><li>韩语:ko</li><li>泰语:th</li><li>越南语:vi</li><li>俄语:ru</li><li>德语:de</li><li>法语:fr</li><li>阿拉伯语:ar</li><li>西班牙语:es</li><li>意大利语:it</li><li>印度尼西亚语:id</li><li>马来西亚语:ms</li><li>葡萄牙语:pt</li><li>土耳其语:tr<br>-</li></ul>
|
|
684
664
|
:type Target: str
|
|
685
|
-
:param _Url:
|
|
686
|
-
|
|
665
|
+
:param _Url: <p>输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。</p>
|
|
687
666
|
:type Url: str
|
|
688
667
|
"""
|
|
689
668
|
self._Data = None
|
|
@@ -692,7 +671,7 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
692
671
|
|
|
693
672
|
@property
|
|
694
673
|
def Data(self):
|
|
695
|
-
r"""
|
|
674
|
+
r"""<p>图片数据的Base64字符串,经Base64编码后不超过 9M,分辨率建议600*800以上,支持PNG、JPG、JPEG格式。</p>
|
|
696
675
|
:rtype: str
|
|
697
676
|
"""
|
|
698
677
|
return self._Data
|
|
@@ -703,27 +682,7 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
703
682
|
|
|
704
683
|
@property
|
|
705
684
|
def Target(self):
|
|
706
|
-
r"""
|
|
707
|
-
|
|
708
|
-
- 中文:zh
|
|
709
|
-
- 繁体(中国台湾):zh-TW
|
|
710
|
-
- 繁体(中国香港):zh-HK
|
|
711
|
-
- 英文:en
|
|
712
|
-
- 日语:ja
|
|
713
|
-
- 韩语:ko
|
|
714
|
-
- 泰语:th
|
|
715
|
-
- 越南语:vi
|
|
716
|
-
- 俄语:ru
|
|
717
|
-
- 德语:de
|
|
718
|
-
- 法语:fr
|
|
719
|
-
- 阿拉伯语:ar
|
|
720
|
-
- 西班牙语:es
|
|
721
|
-
- 意大利语:it
|
|
722
|
-
- 印度尼西亚语:id
|
|
723
|
-
- 马来西亚语:ms
|
|
724
|
-
- 葡萄牙语:pt
|
|
725
|
-
- 土耳其语:tr
|
|
726
|
-
-
|
|
685
|
+
r"""<p>目标语言,支持语言列表:</p><ul><li>中文:zh</li><li>繁体(中国台湾):zh-TW</li><li>繁体(中国香港):zh-HK</li><li>英文:en</li><li>日语:ja</li><li>韩语:ko</li><li>泰语:th</li><li>越南语:vi</li><li>俄语:ru</li><li>德语:de</li><li>法语:fr</li><li>阿拉伯语:ar</li><li>西班牙语:es</li><li>意大利语:it</li><li>印度尼西亚语:id</li><li>马来西亚语:ms</li><li>葡萄牙语:pt</li><li>土耳其语:tr<br>-</li></ul>
|
|
727
686
|
:rtype: str
|
|
728
687
|
"""
|
|
729
688
|
return self._Target
|
|
@@ -734,8 +693,7 @@ class ImageTranslateLLMRequest(AbstractModel):
|
|
|
734
693
|
|
|
735
694
|
@property
|
|
736
695
|
def Url(self):
|
|
737
|
-
r"""
|
|
738
|
-
|
|
696
|
+
r"""<p>输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。</p>
|
|
739
697
|
:rtype: str
|
|
740
698
|
"""
|
|
741
699
|
return self._Url
|
|
@@ -766,20 +724,19 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
766
724
|
|
|
767
725
|
def __init__(self):
|
|
768
726
|
r"""
|
|
769
|
-
:param _Data:
|
|
770
|
-
|
|
727
|
+
:param _Data: <p>图片数据的Base64字符串,输出格式为JPG。</p>
|
|
771
728
|
:type Data: str
|
|
772
|
-
:param _Source:
|
|
729
|
+
:param _Source: <p>原文本主要源语言。</p>
|
|
773
730
|
:type Source: str
|
|
774
|
-
:param _Target:
|
|
731
|
+
:param _Target: <p>目标翻译语言。</p>
|
|
775
732
|
:type Target: str
|
|
776
|
-
:param _SourceText:
|
|
733
|
+
:param _SourceText: <p>图片中的全部原文本。</p>
|
|
777
734
|
:type SourceText: str
|
|
778
|
-
:param _TargetText:
|
|
735
|
+
:param _TargetText: <p>图片中全部译文。</p>
|
|
779
736
|
:type TargetText: str
|
|
780
|
-
:param _Angle:
|
|
737
|
+
:param _Angle: <p>逆时针图片角度,取值范围为0-359</p>
|
|
781
738
|
:type Angle: float
|
|
782
|
-
:param _TransDetails:
|
|
739
|
+
:param _TransDetails: <p>翻译详情信息</p>
|
|
783
740
|
:type TransDetails: list of TransDetail
|
|
784
741
|
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
|
785
742
|
:type RequestId: str
|
|
@@ -795,8 +752,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
795
752
|
|
|
796
753
|
@property
|
|
797
754
|
def Data(self):
|
|
798
|
-
r"""
|
|
799
|
-
|
|
755
|
+
r"""<p>图片数据的Base64字符串,输出格式为JPG。</p>
|
|
800
756
|
:rtype: str
|
|
801
757
|
"""
|
|
802
758
|
return self._Data
|
|
@@ -807,7 +763,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
807
763
|
|
|
808
764
|
@property
|
|
809
765
|
def Source(self):
|
|
810
|
-
r"""
|
|
766
|
+
r"""<p>原文本主要源语言。</p>
|
|
811
767
|
:rtype: str
|
|
812
768
|
"""
|
|
813
769
|
return self._Source
|
|
@@ -818,7 +774,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
818
774
|
|
|
819
775
|
@property
|
|
820
776
|
def Target(self):
|
|
821
|
-
r"""
|
|
777
|
+
r"""<p>目标翻译语言。</p>
|
|
822
778
|
:rtype: str
|
|
823
779
|
"""
|
|
824
780
|
return self._Target
|
|
@@ -829,7 +785,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
829
785
|
|
|
830
786
|
@property
|
|
831
787
|
def SourceText(self):
|
|
832
|
-
r"""
|
|
788
|
+
r"""<p>图片中的全部原文本。</p>
|
|
833
789
|
:rtype: str
|
|
834
790
|
"""
|
|
835
791
|
return self._SourceText
|
|
@@ -840,7 +796,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
840
796
|
|
|
841
797
|
@property
|
|
842
798
|
def TargetText(self):
|
|
843
|
-
r"""
|
|
799
|
+
r"""<p>图片中全部译文。</p>
|
|
844
800
|
:rtype: str
|
|
845
801
|
"""
|
|
846
802
|
return self._TargetText
|
|
@@ -851,7 +807,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
851
807
|
|
|
852
808
|
@property
|
|
853
809
|
def Angle(self):
|
|
854
|
-
r"""
|
|
810
|
+
r"""<p>逆时针图片角度,取值范围为0-359</p>
|
|
855
811
|
:rtype: float
|
|
856
812
|
"""
|
|
857
813
|
return self._Angle
|
|
@@ -862,7 +818,7 @@ class ImageTranslateLLMResponse(AbstractModel):
|
|
|
862
818
|
|
|
863
819
|
@property
|
|
864
820
|
def TransDetails(self):
|
|
865
|
-
r"""
|
|
821
|
+
r"""<p>翻译详情信息</p>
|
|
866
822
|
:rtype: list of TransDetail
|
|
867
823
|
"""
|
|
868
824
|
return self._TransDetails
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# -*- coding: utf8 -*-
|
|
2
|
+
# Copyright (c) 2017-2025 Tencent. 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
|
+
|
|
18
|
+
from tencentcloud.common.abstract_client_async import AbstractClient
|
|
19
|
+
from tencentcloud.tmt.v20180321 import models
|
|
20
|
+
from typing import Dict
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class TmtClient(AbstractClient):
|
|
24
|
+
_apiVersion = '2018-03-21'
|
|
25
|
+
_endpoint = 'tmt.tencentcloudapi.com'
|
|
26
|
+
_service = 'tmt'
|
|
27
|
+
|
|
28
|
+
async def FileTranslate(
|
|
29
|
+
self,
|
|
30
|
+
request: models.FileTranslateRequest,
|
|
31
|
+
opts: Dict = None,
|
|
32
|
+
) -> models.FileTranslateResponse:
|
|
33
|
+
"""
|
|
34
|
+
提交文档原文内容,输出任务ID, 支持原文为单一语种文档(如出现多语言文档,仅支持以选定的源语言相关内容翻译),文件格式有pdf、docx、pptx、xlsx,支持的文本格式有txt、xml、html、markdown、properties。任务翻译数据可保存7天,7天后不再返回任务数据。请注意保存。
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
kwargs = {}
|
|
38
|
+
kwargs["action"] = "FileTranslate"
|
|
39
|
+
kwargs["params"] = request._serialize()
|
|
40
|
+
kwargs["resp_cls"] = models.FileTranslateResponse
|
|
41
|
+
kwargs["headers"] = request.headers
|
|
42
|
+
kwargs["opts"] = opts or {}
|
|
43
|
+
|
|
44
|
+
return await self.call_and_deserialize(**kwargs)
|
|
45
|
+
|
|
46
|
+
async def GetFileTranslate(
|
|
47
|
+
self,
|
|
48
|
+
request: models.GetFileTranslateRequest,
|
|
49
|
+
opts: Dict = None,
|
|
50
|
+
) -> models.GetFileTranslateResponse:
|
|
51
|
+
"""
|
|
52
|
+
在调用文档翻译请求接口后,有回调和轮询两种方式获取识别结果。
|
|
53
|
+
•当采用回调方式时,翻译完成后会将结果通过 POST 请求的形式通知到用户在请求时填写的回调 URL,具体请参见[文件翻译回调说明](https://cloud.tencent.com/document/product/551/91138)。
|
|
54
|
+
• 当采用轮询方式时,需要主动提交任务ID来轮询识别结果,共有任务成功、等待、执行中和失败四种结果,具体信息请参见参数说明。
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
kwargs = {}
|
|
58
|
+
kwargs["action"] = "GetFileTranslate"
|
|
59
|
+
kwargs["params"] = request._serialize()
|
|
60
|
+
kwargs["resp_cls"] = models.GetFileTranslateResponse
|
|
61
|
+
kwargs["headers"] = request.headers
|
|
62
|
+
kwargs["opts"] = opts or {}
|
|
63
|
+
|
|
64
|
+
return await self.call_and_deserialize(**kwargs)
|
|
65
|
+
|
|
66
|
+
async def ImageTranslate(
|
|
67
|
+
self,
|
|
68
|
+
request: models.ImageTranslateRequest,
|
|
69
|
+
opts: Dict = None,
|
|
70
|
+
) -> models.ImageTranslateResponse:
|
|
71
|
+
"""
|
|
72
|
+
提供13种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。<br />
|
|
73
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
kwargs = {}
|
|
77
|
+
kwargs["action"] = "ImageTranslate"
|
|
78
|
+
kwargs["params"] = request._serialize()
|
|
79
|
+
kwargs["resp_cls"] = models.ImageTranslateResponse
|
|
80
|
+
kwargs["headers"] = request.headers
|
|
81
|
+
kwargs["opts"] = opts or {}
|
|
82
|
+
|
|
83
|
+
return await self.call_and_deserialize(**kwargs)
|
|
84
|
+
|
|
85
|
+
async def ImageTranslateLLM(
|
|
86
|
+
self,
|
|
87
|
+
request: models.ImageTranslateLLMRequest,
|
|
88
|
+
opts: Dict = None,
|
|
89
|
+
) -> models.ImageTranslateLLMResponse:
|
|
90
|
+
"""
|
|
91
|
+
提供18种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。
|
|
92
|
+
|
|
93
|
+
- 输入图片格式:png、jpg、jpeg等常用图片格式,不支持gif动图。
|
|
94
|
+
- 输出图片格式:jpg。
|
|
95
|
+
|
|
96
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
kwargs = {}
|
|
100
|
+
kwargs["action"] = "ImageTranslateLLM"
|
|
101
|
+
kwargs["params"] = request._serialize()
|
|
102
|
+
kwargs["resp_cls"] = models.ImageTranslateLLMResponse
|
|
103
|
+
kwargs["headers"] = request.headers
|
|
104
|
+
kwargs["opts"] = opts or {}
|
|
105
|
+
|
|
106
|
+
return await self.call_and_deserialize(**kwargs)
|
|
107
|
+
|
|
108
|
+
async def LanguageDetect(
|
|
109
|
+
self,
|
|
110
|
+
request: models.LanguageDetectRequest,
|
|
111
|
+
opts: Dict = None,
|
|
112
|
+
) -> models.LanguageDetectResponse:
|
|
113
|
+
"""
|
|
114
|
+
可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
|
|
115
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
kwargs = {}
|
|
119
|
+
kwargs["action"] = "LanguageDetect"
|
|
120
|
+
kwargs["params"] = request._serialize()
|
|
121
|
+
kwargs["resp_cls"] = models.LanguageDetectResponse
|
|
122
|
+
kwargs["headers"] = request.headers
|
|
123
|
+
kwargs["opts"] = opts or {}
|
|
124
|
+
|
|
125
|
+
return await self.call_and_deserialize(**kwargs)
|
|
126
|
+
|
|
127
|
+
async def SpeechTranslate(
|
|
128
|
+
self,
|
|
129
|
+
request: models.SpeechTranslateRequest,
|
|
130
|
+
opts: Dict = None,
|
|
131
|
+
) -> models.SpeechTranslateResponse:
|
|
132
|
+
"""
|
|
133
|
+
本接口提供上传音频,将音频进行语音识别并翻译成文本的服务,目前开放中英互译的语音翻译服务。
|
|
134
|
+
待识别和翻译的音频文件可以是 pcm、mp3和speex 格式,其中支持流式传输的只有pcm格式,pcm采样率要求16kHz、位深16bit、单声道,音频内语音清晰。<br/>
|
|
135
|
+
如果采用流式传输的方式,要求每个分片时长200ms~500ms;如果采用非流式的传输方式,要求音频时长不超过8s。注意最后一个分片的IsEnd参数设置为1。<br />
|
|
136
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源部分。
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
kwargs = {}
|
|
140
|
+
kwargs["action"] = "SpeechTranslate"
|
|
141
|
+
kwargs["params"] = request._serialize()
|
|
142
|
+
kwargs["resp_cls"] = models.SpeechTranslateResponse
|
|
143
|
+
kwargs["headers"] = request.headers
|
|
144
|
+
kwargs["opts"] = opts or {}
|
|
145
|
+
|
|
146
|
+
return await self.call_and_deserialize(**kwargs)
|
|
147
|
+
|
|
148
|
+
async def TextTranslate(
|
|
149
|
+
self,
|
|
150
|
+
request: models.TextTranslateRequest,
|
|
151
|
+
opts: Dict = None,
|
|
152
|
+
) -> models.TextTranslateResponse:
|
|
153
|
+
"""
|
|
154
|
+
腾讯翻译为合作伙伴提供文本翻译、文档翻译、交互翻译、AI同传等多种机器翻译服务,具有toB多行业解决方案。作为WMT世界机器翻译大赛冠军,翻译准确度值得信赖,其中,交互翻译能力是业界领先技术;腾讯同传是AI同传业界标杆。<br />
|
|
155
|
+
提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
kwargs = {}
|
|
159
|
+
kwargs["action"] = "TextTranslate"
|
|
160
|
+
kwargs["params"] = request._serialize()
|
|
161
|
+
kwargs["resp_cls"] = models.TextTranslateResponse
|
|
162
|
+
kwargs["headers"] = request.headers
|
|
163
|
+
kwargs["opts"] = opts or {}
|
|
164
|
+
|
|
165
|
+
return await self.call_and_deserialize(**kwargs)
|
|
166
|
+
|
|
167
|
+
async def TextTranslateBatch(
|
|
168
|
+
self,
|
|
169
|
+
request: models.TextTranslateBatchRequest,
|
|
170
|
+
opts: Dict = None,
|
|
171
|
+
) -> models.TextTranslateBatchResponse:
|
|
172
|
+
"""
|
|
173
|
+
批量翻译文本的接口
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
kwargs = {}
|
|
177
|
+
kwargs["action"] = "TextTranslateBatch"
|
|
178
|
+
kwargs["params"] = request._serialize()
|
|
179
|
+
kwargs["resp_cls"] = models.TextTranslateBatchResponse
|
|
180
|
+
kwargs["headers"] = request.headers
|
|
181
|
+
kwargs["opts"] = opts or {}
|
|
182
|
+
|
|
183
|
+
return await self.call_and_deserialize(**kwargs)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tencentcloud-sdk-python-tmt
|
|
3
|
+
Version: 3.1.50
|
|
4
|
+
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
+
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
+
Author: Tencent Cloud
|
|
7
|
+
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Platform: any
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Programming Language :: Python
|
|
14
|
+
Classifier: Programming Language :: Python :: 2.7
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Requires-Dist: tencentcloud-sdk-python-common<4.0.0,>=3.1.50
|
|
19
|
+
|
|
20
|
+
============================
|
|
21
|
+
Tencent Cloud SDK for Python
|
|
22
|
+
============================
|
|
23
|
+
|
|
24
|
+
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
25
|
+
The SDK works on Python versions:
|
|
26
|
+
|
|
27
|
+
* 2.7 and greater, including 3.x
|
|
28
|
+
|
|
29
|
+
Quick Start
|
|
30
|
+
-----------
|
|
31
|
+
|
|
32
|
+
First, install the library:
|
|
33
|
+
|
|
34
|
+
.. code-block:: sh
|
|
35
|
+
|
|
36
|
+
$ pip install tencentcloud-sdk-python-common
|
|
37
|
+
$ pip install tencentcloud-sdk-python-tmt
|
|
38
|
+
|
|
39
|
+
or download source code from github and install:
|
|
40
|
+
|
|
41
|
+
.. code-block:: sh
|
|
42
|
+
|
|
43
|
+
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
44
|
+
$ cd tencentcloud-sdk-python
|
|
45
|
+
$ python package.py --components common tmt
|
|
46
|
+
|
|
@@ -7,6 +7,7 @@ tencentcloud/tmt/v20180321/__init__.py
|
|
|
7
7
|
tencentcloud/tmt/v20180321/errorcodes.py
|
|
8
8
|
tencentcloud/tmt/v20180321/models.py
|
|
9
9
|
tencentcloud/tmt/v20180321/tmt_client.py
|
|
10
|
+
tencentcloud/tmt/v20180321/tmt_client_async.py
|
|
10
11
|
tencentcloud_sdk_python_tmt.egg-info/PKG-INFO
|
|
11
12
|
tencentcloud_sdk_python_tmt.egg-info/SOURCES.txt
|
|
12
13
|
tencentcloud_sdk_python_tmt.egg-info/dependency_links.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tencentcloud-sdk-python-common<4.0.0,>=3.1.50
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 1.2
|
|
2
|
-
Name: tencentcloud-sdk-python-tmt
|
|
3
|
-
Version: 3.0.1478
|
|
4
|
-
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
-
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
-
Author: Tencent Cloud
|
|
7
|
-
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
-
License: Apache License 2.0
|
|
9
|
-
Description: ============================
|
|
10
|
-
Tencent Cloud SDK for Python
|
|
11
|
-
============================
|
|
12
|
-
|
|
13
|
-
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
14
|
-
The SDK works on Python versions:
|
|
15
|
-
|
|
16
|
-
* 2.7 and greater, including 3.x
|
|
17
|
-
|
|
18
|
-
Quick Start
|
|
19
|
-
-----------
|
|
20
|
-
|
|
21
|
-
First, install the library:
|
|
22
|
-
|
|
23
|
-
.. code-block:: sh
|
|
24
|
-
|
|
25
|
-
$ pip install tencentcloud-sdk-python-common
|
|
26
|
-
$ pip install tencentcloud-sdk-python-tmt
|
|
27
|
-
|
|
28
|
-
or download source code from github and install:
|
|
29
|
-
|
|
30
|
-
.. code-block:: sh
|
|
31
|
-
|
|
32
|
-
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
33
|
-
$ cd tencentcloud-sdk-python
|
|
34
|
-
$ python package.py --components common tmt
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Platform: any
|
|
38
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
39
|
-
Classifier: Intended Audience :: Developers
|
|
40
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
41
|
-
Classifier: Programming Language :: Python
|
|
42
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
43
|
-
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
45
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 1.2
|
|
2
|
-
Name: tencentcloud-sdk-python-tmt
|
|
3
|
-
Version: 3.0.1478
|
|
4
|
-
Summary: Tencent Cloud Tmt SDK for Python
|
|
5
|
-
Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
|
|
6
|
-
Author: Tencent Cloud
|
|
7
|
-
Maintainer-email: tencentcloudapi@tencent.com
|
|
8
|
-
License: Apache License 2.0
|
|
9
|
-
Description: ============================
|
|
10
|
-
Tencent Cloud SDK for Python
|
|
11
|
-
============================
|
|
12
|
-
|
|
13
|
-
Tencent Cloud Python Tmt SDK is the official software development kit, which allows Python developers to write software that makes use of Tencent Cloud services like CVM and CBS.
|
|
14
|
-
The SDK works on Python versions:
|
|
15
|
-
|
|
16
|
-
* 2.7 and greater, including 3.x
|
|
17
|
-
|
|
18
|
-
Quick Start
|
|
19
|
-
-----------
|
|
20
|
-
|
|
21
|
-
First, install the library:
|
|
22
|
-
|
|
23
|
-
.. code-block:: sh
|
|
24
|
-
|
|
25
|
-
$ pip install tencentcloud-sdk-python-common
|
|
26
|
-
$ pip install tencentcloud-sdk-python-tmt
|
|
27
|
-
|
|
28
|
-
or download source code from github and install:
|
|
29
|
-
|
|
30
|
-
.. code-block:: sh
|
|
31
|
-
|
|
32
|
-
$ git clone https://github.com/tencentcloud/tencentcloud-sdk-python.git
|
|
33
|
-
$ cd tencentcloud-sdk-python
|
|
34
|
-
$ python package.py --components common tmt
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
Platform: any
|
|
38
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
39
|
-
Classifier: Intended Audience :: Developers
|
|
40
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
41
|
-
Classifier: Programming Language :: Python
|
|
42
|
-
Classifier: Programming Language :: Python :: 2.7
|
|
43
|
-
Classifier: Programming Language :: Python :: 3
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
45
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
tencentcloud-sdk-python-common<4.0.0,>=3.0.1478
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|