tencentcloud-sdk-tmt 3.0.1057 → 3.0.1059
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.
- checksums.yaml +4 -4
- data/lib/VERSION +1 -1
- data/lib/v20180321/client.rb +29 -0
- data/lib/v20180321/models.rb +114 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a7a627b956c09de1b88d663c11961bfae503160
|
4
|
+
data.tar.gz: d8f46a7bcaa879084483d8d5fbdc03761783b418
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afa4e3fa271f1014620fd6e54fee898a06f9c19153bf8d131e9bc5ef3328c35417ff6f7b0a7875215426e7e9c19ffa811695fef88b830bfde585ba4e9858181b
|
7
|
+
data.tar.gz: 2bfb2f1f1a70084309212a75ca915b6ac5b9da2ff97cbdcae798710baa33ca00ced98d720c62b6769f08b87878768d168ad8d1b1a61948b6f4b8a1f22461897d
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.1059
|
data/lib/v20180321/client.rb
CHANGED
@@ -104,6 +104,35 @@ module TencentCloud
|
|
104
104
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
105
105
|
end
|
106
106
|
|
107
|
+
# 提供18种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。
|
108
|
+
|
109
|
+
# - 输入图片格式:png、jpg、jpeg等常用图片格式,不支持gif动图。
|
110
|
+
# - 输出图片格式:jpg。
|
111
|
+
|
112
|
+
# 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
113
|
+
|
114
|
+
# @param request: Request instance for ImageTranslateLLM.
|
115
|
+
# @type request: :class:`Tencentcloud::tmt::V20180321::ImageTranslateLLMRequest`
|
116
|
+
# @rtype: :class:`Tencentcloud::tmt::V20180321::ImageTranslateLLMResponse`
|
117
|
+
def ImageTranslateLLM(request)
|
118
|
+
body = send_request('ImageTranslateLLM', request.serialize)
|
119
|
+
response = JSON.parse(body)
|
120
|
+
if response['Response'].key?('Error') == false
|
121
|
+
model = ImageTranslateLLMResponse.new
|
122
|
+
model.deserialize(response['Response'])
|
123
|
+
model
|
124
|
+
else
|
125
|
+
code = response['Response']['Error']['Code']
|
126
|
+
message = response['Response']['Error']['Message']
|
127
|
+
reqid = response['Response']['RequestId']
|
128
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
129
|
+
end
|
130
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
131
|
+
raise e
|
132
|
+
rescue StandardError => e
|
133
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
134
|
+
end
|
135
|
+
|
107
136
|
# 可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
|
108
137
|
# 提示:对于一般开发者,我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
|
109
138
|
|
data/lib/v20180321/models.rb
CHANGED
@@ -17,6 +17,34 @@
|
|
17
17
|
module TencentCloud
|
18
18
|
module Tmt
|
19
19
|
module V20180321
|
20
|
+
# 段落文本框位置:x,y代表左上顶点,width和height代表宽高
|
21
|
+
class BoundingBox < TencentCloud::Common::AbstractModel
|
22
|
+
# @param X: 左上顶点x坐标
|
23
|
+
# @type X: Integer
|
24
|
+
# @param Y: 左上顶点y坐标
|
25
|
+
# @type Y: Integer
|
26
|
+
# @param Width: 宽
|
27
|
+
# @type Width: Integer
|
28
|
+
# @param Height: 高
|
29
|
+
# @type Height: Integer
|
30
|
+
|
31
|
+
attr_accessor :X, :Y, :Width, :Height
|
32
|
+
|
33
|
+
def initialize(x=nil, y=nil, width=nil, height=nil)
|
34
|
+
@X = x
|
35
|
+
@Y = y
|
36
|
+
@Width = width
|
37
|
+
@Height = height
|
38
|
+
end
|
39
|
+
|
40
|
+
def deserialize(params)
|
41
|
+
@X = params['X']
|
42
|
+
@Y = params['Y']
|
43
|
+
@Width = params['Width']
|
44
|
+
@Height = params['Height']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
20
48
|
# FileTranslate请求参数结构体
|
21
49
|
class FileTranslateRequest < TencentCloud::Common::AbstractModel
|
22
50
|
# @param Source: 源语言,支持
|
@@ -223,6 +251,53 @@ module TencentCloud
|
|
223
251
|
end
|
224
252
|
end
|
225
253
|
|
254
|
+
# ImageTranslateLLM请求参数结构体
|
255
|
+
class ImageTranslateLLMRequest < TencentCloud::Common::AbstractModel
|
256
|
+
# @param Url: 输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。
|
257
|
+
# @type Url: String
|
258
|
+
|
259
|
+
attr_accessor :Url
|
260
|
+
|
261
|
+
def initialize(url=nil)
|
262
|
+
@Url = url
|
263
|
+
end
|
264
|
+
|
265
|
+
def deserialize(params)
|
266
|
+
@Url = params['Url']
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
# ImageTranslateLLM返回参数结构体
|
271
|
+
class ImageTranslateLLMResponse < TencentCloud::Common::AbstractModel
|
272
|
+
# @param Angle: 逆时针图片角度,取值范围为0-359
|
273
|
+
# @type Angle: Float
|
274
|
+
# @param TransDetails: 翻译详情信息
|
275
|
+
# @type TransDetails: Array
|
276
|
+
# @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
|
277
|
+
# @type RequestId: String
|
278
|
+
|
279
|
+
attr_accessor :Angle, :TransDetails, :RequestId
|
280
|
+
|
281
|
+
def initialize(angle=nil, transdetails=nil, requestid=nil)
|
282
|
+
@Angle = angle
|
283
|
+
@TransDetails = transdetails
|
284
|
+
@RequestId = requestid
|
285
|
+
end
|
286
|
+
|
287
|
+
def deserialize(params)
|
288
|
+
@Angle = params['Angle']
|
289
|
+
unless params['TransDetails'].nil?
|
290
|
+
@TransDetails = []
|
291
|
+
params['TransDetails'].each do |i|
|
292
|
+
transdetail_tmp = TransDetail.new
|
293
|
+
transdetail_tmp.deserialize(i)
|
294
|
+
@TransDetails << transdetail_tmp
|
295
|
+
end
|
296
|
+
end
|
297
|
+
@RequestId = params['RequestId']
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
226
301
|
# ImageTranslate请求参数结构体
|
227
302
|
class ImageTranslateRequest < TencentCloud::Common::AbstractModel
|
228
303
|
# @param SessionUuid: 唯一id,返回时原样返回
|
@@ -722,6 +797,45 @@ module TencentCloud
|
|
722
797
|
end
|
723
798
|
end
|
724
799
|
|
800
|
+
# 大模型图片翻译详情信息
|
801
|
+
class TransDetail < TencentCloud::Common::AbstractModel
|
802
|
+
# @param SourceLineText: 当前行的原文本
|
803
|
+
# @type SourceLineText: String
|
804
|
+
# @param TargetLineText: 当前行的译文
|
805
|
+
# @type TargetLineText: String
|
806
|
+
# @param BoundingBox: 段落文本框位置
|
807
|
+
# @type BoundingBox: :class:`Tencentcloud::Tmt.v20180321.models.BoundingBox`
|
808
|
+
# @param LinesCount: 行数
|
809
|
+
# @type LinesCount: Integer
|
810
|
+
# @param LineHeight: 行高
|
811
|
+
# @type LineHeight: Integer
|
812
|
+
# @param SpamCode: 正常段落spam_code字段为0;如果存在spam_code字段且值大于0(1: 命中垃圾检查;2: 命中安全策略;3: 其他。),则命中安全检查被过滤。
|
813
|
+
# @type SpamCode: Integer
|
814
|
+
|
815
|
+
attr_accessor :SourceLineText, :TargetLineText, :BoundingBox, :LinesCount, :LineHeight, :SpamCode
|
816
|
+
|
817
|
+
def initialize(sourcelinetext=nil, targetlinetext=nil, boundingbox=nil, linescount=nil, lineheight=nil, spamcode=nil)
|
818
|
+
@SourceLineText = sourcelinetext
|
819
|
+
@TargetLineText = targetlinetext
|
820
|
+
@BoundingBox = boundingbox
|
821
|
+
@LinesCount = linescount
|
822
|
+
@LineHeight = lineheight
|
823
|
+
@SpamCode = spamcode
|
824
|
+
end
|
825
|
+
|
826
|
+
def deserialize(params)
|
827
|
+
@SourceLineText = params['SourceLineText']
|
828
|
+
@TargetLineText = params['TargetLineText']
|
829
|
+
unless params['BoundingBox'].nil?
|
830
|
+
@BoundingBox = BoundingBox.new
|
831
|
+
@BoundingBox.deserialize(params['BoundingBox'])
|
832
|
+
end
|
833
|
+
@LinesCount = params['LinesCount']
|
834
|
+
@LineHeight = params['LineHeight']
|
835
|
+
@SpamCode = params['SpamCode']
|
836
|
+
end
|
837
|
+
end
|
838
|
+
|
725
839
|
end
|
726
840
|
end
|
727
841
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tencentcloud-sdk-tmt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1059
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tencent Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|