tencentcloud-sdk-tmt 3.0.1058 → 3.0.1060

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff38d99d8fba31bbcfb059fc4a2d1289d3272e78
4
- data.tar.gz: 7bca48b8540699e42c578515b00df21d8f6a8dda
3
+ metadata.gz: 0916cfdfcc64de7906806a3df841b3e3f7984033
4
+ data.tar.gz: 42cf4c4630eb62022f6f8964f1544abc830c505f
5
5
  SHA512:
6
- metadata.gz: fbb460f81ce8b0eafdde9ae6f647537c227a7894018fadc56fcec025b6659a7d0408b1bc0c4d2efe7711b7c6a28215d0dc8cd9aaa0156b7141e5d8fe2bcac5a6
7
- data.tar.gz: f5145265897d50a309339fcf8eca638a622428863421b675dc4ffdf2a47eadab62c874d074bd2a74b9e1ea3bee6234b70fdaf4304183066a5414035939de3313
6
+ metadata.gz: 21bc5ec43fbcbb37aded6bdd0b3ca55e377dc0cfe327ecca2ddc37fe07ed91c0dc02ac24cd309c64b9b3366c891e52c411e084a779d22b44a0d247bf9f41fd73
7
+ data.tar.gz: 5a2b765f4d17a502d4811e68fedea494a99eb23910c38dfebe4436f4c12754ba9265983b615f8355a9941672fb7325ca30c992fbb6e43641eb9184a0f0543d22
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1058
1
+ 3.0.1060
@@ -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
 
@@ -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,101 @@ module TencentCloud
223
251
  end
224
252
  end
225
253
 
254
+ # ImageTranslateLLM请求参数结构体
255
+ class ImageTranslateLLMRequest < TencentCloud::Common::AbstractModel
256
+ # @param Data: 图片数据的Base64字符串,经Base64编码后不超过 9M,分辨率建议600*800以上,支持PNG、JPG、JPEG格式。
257
+ # @type Data: String
258
+ # @param Target: 目标语言,支持语言列表:
259
+
260
+ # - 中文:zh
261
+ # - 繁体(台湾):zh-TW
262
+ # - 繁体(香港):zh-HK
263
+ # - 英文:en
264
+ # - 日语:ja
265
+ # - 韩语:ko
266
+ # - 泰语:th
267
+ # - 越南语:vi
268
+ # - 俄语:ru
269
+ # - 德语:de
270
+ # - 法语:fr
271
+ # - 阿拉伯语:ar
272
+ # - 西班牙语:es
273
+ # - 意大利语:it
274
+ # - 印度尼西亚语:id
275
+ # - 马来西亚语:ms
276
+ # - 葡萄牙语:pt
277
+ # - 土耳其语:tr
278
+ # -
279
+ # @type Target: String
280
+ # @param Url: 输入图 Url。 使用Url的时候,Data参数需要传入""。 图片限制:小于 10MB,分辨率建议600*800以上,格式支持 jpg、jpeg、png。
281
+ # @type Url: String
282
+
283
+ attr_accessor :Data, :Target, :Url
284
+
285
+ def initialize(data=nil, target=nil, url=nil)
286
+ @Data = data
287
+ @Target = target
288
+ @Url = url
289
+ end
290
+
291
+ def deserialize(params)
292
+ @Data = params['Data']
293
+ @Target = params['Target']
294
+ @Url = params['Url']
295
+ end
296
+ end
297
+
298
+ # ImageTranslateLLM返回参数结构体
299
+ class ImageTranslateLLMResponse < TencentCloud::Common::AbstractModel
300
+ # @param Data: 图片数据的Base64字符串,输出格式为JPG。
301
+ # @type Data: String
302
+ # @param Source: 原文本主要源语言。
303
+ # @type Source: String
304
+ # @param Target: 目标翻译语言。
305
+ # @type Target: String
306
+ # @param SourceText: 图片中的全部原文本。
307
+ # @type SourceText: String
308
+ # @param TargetText: 图片中全部译文。
309
+ # @type TargetText: String
310
+ # @param Angle: 逆时针图片角度,取值范围为0-359
311
+ # @type Angle: Float
312
+ # @param TransDetails: 翻译详情信息
313
+ # @type TransDetails: Array
314
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
315
+ # @type RequestId: String
316
+
317
+ attr_accessor :Data, :Source, :Target, :SourceText, :TargetText, :Angle, :TransDetails, :RequestId
318
+
319
+ def initialize(data=nil, source=nil, target=nil, sourcetext=nil, targettext=nil, angle=nil, transdetails=nil, requestid=nil)
320
+ @Data = data
321
+ @Source = source
322
+ @Target = target
323
+ @SourceText = sourcetext
324
+ @TargetText = targettext
325
+ @Angle = angle
326
+ @TransDetails = transdetails
327
+ @RequestId = requestid
328
+ end
329
+
330
+ def deserialize(params)
331
+ @Data = params['Data']
332
+ @Source = params['Source']
333
+ @Target = params['Target']
334
+ @SourceText = params['SourceText']
335
+ @TargetText = params['TargetText']
336
+ @Angle = params['Angle']
337
+ unless params['TransDetails'].nil?
338
+ @TransDetails = []
339
+ params['TransDetails'].each do |i|
340
+ transdetail_tmp = TransDetail.new
341
+ transdetail_tmp.deserialize(i)
342
+ @TransDetails << transdetail_tmp
343
+ end
344
+ end
345
+ @RequestId = params['RequestId']
346
+ end
347
+ end
348
+
226
349
  # ImageTranslate请求参数结构体
227
350
  class ImageTranslateRequest < TencentCloud::Common::AbstractModel
228
351
  # @param SessionUuid: 唯一id,返回时原样返回
@@ -722,6 +845,45 @@ module TencentCloud
722
845
  end
723
846
  end
724
847
 
848
+ # 大模型图片翻译详情信息
849
+ class TransDetail < TencentCloud::Common::AbstractModel
850
+ # @param SourceLineText: 当前行的原文本
851
+ # @type SourceLineText: String
852
+ # @param TargetLineText: 当前行的译文
853
+ # @type TargetLineText: String
854
+ # @param BoundingBox: 段落文本框位置
855
+ # @type BoundingBox: :class:`Tencentcloud::Tmt.v20180321.models.BoundingBox`
856
+ # @param LinesCount: 行数
857
+ # @type LinesCount: Integer
858
+ # @param LineHeight: 行高
859
+ # @type LineHeight: Integer
860
+ # @param SpamCode: 正常段落spam_code字段为0;如果存在spam_code字段且值大于0(1: 命中垃圾检查;2: 命中安全策略;3: 其他。),则命中安全检查被过滤。
861
+ # @type SpamCode: Integer
862
+
863
+ attr_accessor :SourceLineText, :TargetLineText, :BoundingBox, :LinesCount, :LineHeight, :SpamCode
864
+
865
+ def initialize(sourcelinetext=nil, targetlinetext=nil, boundingbox=nil, linescount=nil, lineheight=nil, spamcode=nil)
866
+ @SourceLineText = sourcelinetext
867
+ @TargetLineText = targetlinetext
868
+ @BoundingBox = boundingbox
869
+ @LinesCount = linescount
870
+ @LineHeight = lineheight
871
+ @SpamCode = spamcode
872
+ end
873
+
874
+ def deserialize(params)
875
+ @SourceLineText = params['SourceLineText']
876
+ @TargetLineText = params['TargetLineText']
877
+ unless params['BoundingBox'].nil?
878
+ @BoundingBox = BoundingBox.new
879
+ @BoundingBox.deserialize(params['BoundingBox'])
880
+ end
881
+ @LinesCount = params['LinesCount']
882
+ @LineHeight = params['LineHeight']
883
+ @SpamCode = params['SpamCode']
884
+ end
885
+ end
886
+
725
887
  end
726
888
  end
727
889
  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.1058
4
+ version: 3.0.1060
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-13 00:00:00.000000000 Z
11
+ date: 2025-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common