tencentcloud-sdk-python-tmt 3.0.1377__tar.gz → 3.0.1379__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.
Files changed (16) hide show
  1. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/PKG-INFO +1 -1
  2. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/setup.py +1 -1
  3. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud/__init__.py +1 -1
  4. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud/tmt/v20180321/errorcodes.py +3 -0
  5. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud/tmt/v20180321/models.py +296 -1
  6. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud/tmt/v20180321/tmt_client.py +28 -0
  7. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud_sdk_python_tmt.egg-info/PKG-INFO +1 -1
  8. tencentcloud-sdk-python-tmt-3.0.1379/tencentcloud_sdk_python_tmt.egg-info/requires.txt +1 -0
  9. tencentcloud-sdk-python-tmt-3.0.1377/tencentcloud_sdk_python_tmt.egg-info/requires.txt +0 -1
  10. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/README.rst +0 -0
  11. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/setup.cfg +0 -0
  12. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud/tmt/__init__.py +0 -0
  13. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud/tmt/v20180321/__init__.py +0 -0
  14. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud_sdk_python_tmt.egg-info/SOURCES.txt +0 -0
  15. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud_sdk_python_tmt.egg-info/dependency_links.txt +0 -0
  16. {tencentcloud-sdk-python-tmt-3.0.1377 → tencentcloud-sdk-python-tmt-3.0.1379}/tencentcloud_sdk_python_tmt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: tencentcloud-sdk-python-tmt
3
- Version: 3.0.1377
3
+ Version: 3.0.1379
4
4
  Summary: Tencent Cloud Tmt SDK for Python
5
5
  Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
6
6
  Author: Tencent Cloud
@@ -8,7 +8,7 @@ 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.0.1377"],
11
+ install_requires=["tencentcloud-sdk-python-common==3.0.1379"],
12
12
  version=tencentcloud.__version__,
13
13
  description='Tencent Cloud Tmt SDK for Python',
14
14
  long_description=open('README.rst').read(),
@@ -14,4 +14,4 @@
14
14
  # limitations under the License.
15
15
 
16
16
 
17
- __version__ = '3.0.1377'
17
+ __version__ = '3.0.1379'
@@ -17,6 +17,9 @@
17
17
  # 操作失败。
18
18
  FAILEDOPERATION = 'FailedOperation'
19
19
 
20
+ # 图片下载出错
21
+ FAILEDOPERATION_DOWNLOADERR = 'FailedOperation.DownloadErr'
22
+
20
23
  # 用户区域与请求服务区域不一致。
21
24
  FAILEDOPERATION_ERRORUSERAREA = 'FailedOperation.ErrorUserArea'
22
25
 
@@ -18,6 +18,87 @@ import warnings
18
18
  from tencentcloud.common.abstract_model import AbstractModel
19
19
 
20
20
 
21
+ class BoundingBox(AbstractModel):
22
+ """段落文本框位置:x,y代表左上顶点,width和height代表宽高
23
+
24
+ """
25
+
26
+ def __init__(self):
27
+ r"""
28
+ :param _X: 左上顶点x坐标
29
+ :type X: int
30
+ :param _Y: 左上顶点y坐标
31
+ :type Y: int
32
+ :param _Width: 宽
33
+ :type Width: int
34
+ :param _Height: 高
35
+ :type Height: int
36
+ """
37
+ self._X = None
38
+ self._Y = None
39
+ self._Width = None
40
+ self._Height = None
41
+
42
+ @property
43
+ def X(self):
44
+ """左上顶点x坐标
45
+ :rtype: int
46
+ """
47
+ return self._X
48
+
49
+ @X.setter
50
+ def X(self, X):
51
+ self._X = X
52
+
53
+ @property
54
+ def Y(self):
55
+ """左上顶点y坐标
56
+ :rtype: int
57
+ """
58
+ return self._Y
59
+
60
+ @Y.setter
61
+ def Y(self, Y):
62
+ self._Y = Y
63
+
64
+ @property
65
+ def Width(self):
66
+ """宽
67
+ :rtype: int
68
+ """
69
+ return self._Width
70
+
71
+ @Width.setter
72
+ def Width(self, Width):
73
+ self._Width = Width
74
+
75
+ @property
76
+ def Height(self):
77
+ """高
78
+ :rtype: int
79
+ """
80
+ return self._Height
81
+
82
+ @Height.setter
83
+ def Height(self, Height):
84
+ self._Height = Height
85
+
86
+
87
+ def _deserialize(self, params):
88
+ self._X = params.get("X")
89
+ self._Y = params.get("Y")
90
+ self._Width = params.get("Width")
91
+ self._Height = params.get("Height")
92
+ memeber_set = set(params.keys())
93
+ for name, value in vars(self).items():
94
+ property_name = name[1:]
95
+ if property_name in memeber_set:
96
+ memeber_set.remove(property_name)
97
+ if len(memeber_set) > 0:
98
+ warnings.warn("%s fileds are useless." % ",".join(memeber_set))
99
+
100
+
101
+
21
102
  class FileTranslateRequest(AbstractModel):
22
103
  """FileTranslate请求参数结构体
23
104
 
@@ -519,6 +600,107 @@ class ImageRecord(AbstractModel):
519
600
 
520
601
 
521
602
 
603
+ class ImageTranslateLLMRequest(AbstractModel):
604
+ """ImageTranslateLLM请求参数结构体
605
+
606
+ """
607
+
608
+ def __init__(self):
609
+ r"""
610
+ :param _Url: 输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。
611
+
612
+ :type Url: str
613
+ """
614
+ self._Url = None
615
+
616
+ @property
617
+ def Url(self):
618
+ """输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。
619
+
620
+ :rtype: str
621
+ """
622
+ return self._Url
623
+
624
+ @Url.setter
625
+ def Url(self, Url):
626
+ self._Url = Url
627
+
628
+
629
+ def _deserialize(self, params):
630
+ self._Url = params.get("Url")
631
+ memeber_set = set(params.keys())
632
+ for name, value in vars(self).items():
633
+ property_name = name[1:]
634
+ if property_name in memeber_set:
635
+ memeber_set.remove(property_name)
636
+ if len(memeber_set) > 0:
637
+ warnings.warn("%s fileds are useless." % ",".join(memeber_set))
638
+
639
+
640
+
641
+ class ImageTranslateLLMResponse(AbstractModel):
642
+ """ImageTranslateLLM返回参数结构体
643
+
644
+ """
645
+
646
+ def __init__(self):
647
+ r"""
648
+ :param _Angle: 逆时针图片角度,取值范围为0-359
649
+ :type Angle: float
650
+ :param _TransDetails: 翻译详情信息
651
+ :type TransDetails: list of TransDetail
652
+ :param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
653
+ :type RequestId: str
654
+ """
655
+ self._Angle = None
656
+ self._TransDetails = None
657
+ self._RequestId = None
658
+
659
+ @property
660
+ def Angle(self):
661
+ """逆时针图片角度,取值范围为0-359
662
+ :rtype: float
663
+ """
664
+ return self._Angle
665
+
666
+ @Angle.setter
667
+ def Angle(self, Angle):
668
+ self._Angle = Angle
669
+
670
+ @property
671
+ def TransDetails(self):
672
+ """翻译详情信息
673
+ :rtype: list of TransDetail
674
+ """
675
+ return self._TransDetails
676
+
677
+ @TransDetails.setter
678
+ def TransDetails(self, TransDetails):
679
+ self._TransDetails = TransDetails
680
+
681
+ @property
682
+ def RequestId(self):
683
+ """唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
684
+ :rtype: str
685
+ """
686
+ return self._RequestId
687
+
688
+ @RequestId.setter
689
+ def RequestId(self, RequestId):
690
+ self._RequestId = RequestId
691
+
692
+
693
+ def _deserialize(self, params):
694
+ self._Angle = params.get("Angle")
695
+ if params.get("TransDetails") is not None:
696
+ self._TransDetails = []
697
+ for item in params.get("TransDetails"):
698
+ obj = TransDetail()
699
+ obj._deserialize(item)
700
+ self._TransDetails.append(obj)
701
+ self._RequestId = params.get("RequestId")
702
+
703
+
522
704
  class ImageTranslateRequest(AbstractModel):
523
705
  """ImageTranslate请求参数结构体
524
706
 
@@ -1880,4 +2062,117 @@ class TextTranslateResponse(AbstractModel):
1880
2062
  self._Source = params.get("Source")
1881
2063
  self._Target = params.get("Target")
1882
2064
  self._UsedAmount = params.get("UsedAmount")
1883
- self._RequestId = params.get("RequestId")
2065
+ self._RequestId = params.get("RequestId")
2066
+
2067
+
2068
+ class TransDetail(AbstractModel):
2069
+ """大模型图片翻译详情信息
2070
+
2071
+ """
2072
+
2073
+ def __init__(self):
2074
+ r"""
2075
+ :param _SourceLineText: 当前行的原文本
2076
+ :type SourceLineText: str
2077
+ :param _TargetLineText: 当前行的译文
2078
+ :type TargetLineText: str
2079
+ :param _BoundingBox: 段落文本框位置
2080
+ :type BoundingBox: :class:`tencentcloud.tmt.v20180321.models.BoundingBox`
2081
+ :param _LinesCount: 行数
2082
+ :type LinesCount: int
2083
+ :param _LineHeight: 行高
2084
+ :type LineHeight: int
2085
+ :param _SpamCode: 正常段落spam_code字段为0;如果存在spam_code字段且值大于0(1: 命中垃圾检查;2: 命中安全策略;3: 其他。),则命中安全检查被过滤。
2086
+ :type SpamCode: int
2087
+ """
2088
+ self._SourceLineText = None
2089
+ self._TargetLineText = None
2090
+ self._BoundingBox = None
2091
+ self._LinesCount = None
2092
+ self._LineHeight = None
2093
+ self._SpamCode = None
2094
+
2095
+ @property
2096
+ def SourceLineText(self):
2097
+ """当前行的原文本
2098
+ :rtype: str
2099
+ """
2100
+ return self._SourceLineText
2101
+
2102
+ @SourceLineText.setter
2103
+ def SourceLineText(self, SourceLineText):
2104
+ self._SourceLineText = SourceLineText
2105
+
2106
+ @property
2107
+ def TargetLineText(self):
2108
+ """当前行的译文
2109
+ :rtype: str
2110
+ """
2111
+ return self._TargetLineText
2112
+
2113
+ @TargetLineText.setter
2114
+ def TargetLineText(self, TargetLineText):
2115
+ self._TargetLineText = TargetLineText
2116
+
2117
+ @property
2118
+ def BoundingBox(self):
2119
+ """段落文本框位置
2120
+ :rtype: :class:`tencentcloud.tmt.v20180321.models.BoundingBox`
2121
+ """
2122
+ return self._BoundingBox
2123
+
2124
+ @BoundingBox.setter
2125
+ def BoundingBox(self, BoundingBox):
2126
+ self._BoundingBox = BoundingBox
2127
+
2128
+ @property
2129
+ def LinesCount(self):
2130
+ """行数
2131
+ :rtype: int
2132
+ """
2133
+ return self._LinesCount
2134
+
2135
+ @LinesCount.setter
2136
+ def LinesCount(self, LinesCount):
2137
+ self._LinesCount = LinesCount
2138
+
2139
+ @property
2140
+ def LineHeight(self):
2141
+ """行高
2142
+ :rtype: int
2143
+ """
2144
+ return self._LineHeight
2145
+
2146
+ @LineHeight.setter
2147
+ def LineHeight(self, LineHeight):
2148
+ self._LineHeight = LineHeight
2149
+
2150
+ @property
2151
+ def SpamCode(self):
2152
+ """正常段落spam_code字段为0;如果存在spam_code字段且值大于0(1: 命中垃圾检查;2: 命中安全策略;3: 其他。),则命中安全检查被过滤。
2153
+ :rtype: int
2154
+ """
2155
+ return self._SpamCode
2156
+
2157
+ @SpamCode.setter
2158
+ def SpamCode(self, SpamCode):
2159
+ self._SpamCode = SpamCode
2160
+
2161
+
2162
+ def _deserialize(self, params):
2163
+ self._SourceLineText = params.get("SourceLineText")
2164
+ self._TargetLineText = params.get("TargetLineText")
2165
+ if params.get("BoundingBox") is not None:
2166
+ self._BoundingBox = BoundingBox()
2167
+ self._BoundingBox._deserialize(params.get("BoundingBox"))
2168
+ self._LinesCount = params.get("LinesCount")
2169
+ self._LineHeight = params.get("LineHeight")
2170
+ self._SpamCode = params.get("SpamCode")
2171
+ memeber_set = set(params.keys())
2172
+ for name, value in vars(self).items():
2173
+ property_name = name[1:]
2174
+ if property_name in memeber_set:
2175
+ memeber_set.remove(property_name)
2176
+ if len(memeber_set) > 0:
2177
+ warnings.warn("%s fileds are useless." % ",".join(memeber_set))
2178
+
@@ -98,6 +98,34 @@ class TmtClient(AbstractClient):
98
98
  raise TencentCloudSDKException(type(e).__name__, str(e))
99
99
 
100
100
 
101
+ def ImageTranslateLLM(self, request):
102
+ """提供18种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。
103
+
104
+ - 输入图片格式:png、jpg、jpeg等常用图片格式,不支持gif动图。
105
+ - 输出图片格式:jpg。
106
+
107
+ 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
108
+
109
+ :param request: Request instance for ImageTranslateLLM.
110
+ :type request: :class:`tencentcloud.tmt.v20180321.models.ImageTranslateLLMRequest`
111
+ :rtype: :class:`tencentcloud.tmt.v20180321.models.ImageTranslateLLMResponse`
112
+
113
+ """
114
+ try:
115
+ params = request._serialize()
116
+ headers = request.headers
117
+ body = self.call("ImageTranslateLLM", params, headers=headers)
118
+ response = json.loads(body)
119
+ model = models.ImageTranslateLLMResponse()
120
+ model._deserialize(response["Response"])
121
+ return model
122
+ except Exception as e:
123
+ if isinstance(e, TencentCloudSDKException):
124
+ raise
125
+ else:
126
+ raise TencentCloudSDKException(type(e).__name__, str(e))
127
+
128
+
101
129
  def LanguageDetect(self, request):
102
130
  """可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
103
131
  提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: tencentcloud-sdk-python-tmt
3
- Version: 3.0.1377
3
+ Version: 3.0.1379
4
4
  Summary: Tencent Cloud Tmt SDK for Python
5
5
  Home-page: https://github.com/TencentCloud/tencentcloud-sdk-python
6
6
  Author: Tencent Cloud
@@ -0,0 +1 @@
1
+ tencentcloud-sdk-python-common==3.0.1379
@@ -1 +0,0 @@
1
- tencentcloud-sdk-python-common==3.0.1377