tencentcloud-sdk-hunyuan 3.0.741 → 3.0.742

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b851110ab877f073099c3a0ff4b75bfc4863db8
4
- data.tar.gz: 08014f7ba5388bea05c60b42f8db7574d8d2d1d5
3
+ metadata.gz: 5ae186995e6e651f55659e6faa5ed56f5b6991cd
4
+ data.tar.gz: 9f9e60bf66ffedabd87eaea018143d6e90d9c81b
5
5
  SHA512:
6
- metadata.gz: 74f5b58fdf229bee0aa25a4aa3b30ad4ed6acd3005fd43be6f77cbe3f4f53cb0fdeefbd3c613ab8ecf2f812671faded78a6e55ec6428e107cc7a142711ce53e9
7
- data.tar.gz: 506eaebb9fc54091a299dfcb91284d8cb524f4c8c1f9ffb2d965664c9b119f401394bd5630b6d7c14a9c0dc8dfa1bcf1ce02d6e8b448eff0faa0d3a9e1e8e687
6
+ metadata.gz: 151bf6f1fc593ccfc96038396bdf4520a198220f6ccb4110ff61a8cddc584e2d235a9d1504b19036ebb4fd1449d4700d4b2b1f4fdf58c281fd29783d0d9a04b7
7
+ data.tar.gz: f11adffea0332bceeebfcadd3d4923b060c07d54d1648c2f1b49e4b9da4ef2ddcda0074ed2bab4aaafd6ca0e6aa3d618ad06cc3d01101e5a386823153853cef6
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.741
1
+ 3.0.742
@@ -85,6 +85,30 @@ module TencentCloud
85
85
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
86
86
  end
87
87
 
88
+ # 腾讯混元-Embedding接口,可以将文本转化为高质量的向量数据。
89
+
90
+ # @param request: Request instance for GetEmbedding.
91
+ # @type request: :class:`Tencentcloud::hunyuan::V20230901::GetEmbeddingRequest`
92
+ # @rtype: :class:`Tencentcloud::hunyuan::V20230901::GetEmbeddingResponse`
93
+ def GetEmbedding(request)
94
+ body = send_request('GetEmbedding', request.serialize)
95
+ response = JSON.parse(body)
96
+ if response['Response'].key?('Error') == false
97
+ model = GetEmbeddingResponse.new
98
+ model.deserialize(response['Response'])
99
+ model
100
+ else
101
+ code = response['Response']['Error']['Code']
102
+ message = response['Response']['Error']['Message']
103
+ reqid = response['Response']['RequestId']
104
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
105
+ end
106
+ rescue TencentCloud::Common::TencentCloudSDKException => e
107
+ raise e
108
+ rescue StandardError => e
109
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
110
+ end
111
+
88
112
  # 该接口用于计算文本对应Token数、字符数。
89
113
 
90
114
  # @param request: Request instance for GetTokenCount.
@@ -254,6 +254,53 @@ module TencentCloud
254
254
  end
255
255
  end
256
256
 
257
+ # embedding 信息,当前不支持批量,所以数组元素数目为1。
258
+ class EmbeddingData < TencentCloud::Common::AbstractModel
259
+ # @param Embedding: embedding 信息。
260
+ # 注意:此字段可能返回 null,表示取不到有效值。
261
+ # @type Embedding: Array
262
+ # @param Index: 下标。
263
+ # 注意:此字段可能返回 null,表示取不到有效值。
264
+ # @type Index: Integer
265
+ # @param Object: embedding
266
+ # 注意:此字段可能返回 null,表示取不到有效值。
267
+ # @type Object: String
268
+
269
+ attr_accessor :Embedding, :Index, :Object
270
+
271
+ def initialize(embedding=nil, index=nil, object=nil)
272
+ @Embedding = embedding
273
+ @Index = index
274
+ @Object = object
275
+ end
276
+
277
+ def deserialize(params)
278
+ @Embedding = params['Embedding']
279
+ @Index = params['Index']
280
+ @Object = params['Object']
281
+ end
282
+ end
283
+
284
+ # token 使用计数。
285
+ class EmbeddingUsage < TencentCloud::Common::AbstractModel
286
+ # @param PromptTokens: 输入Token数。
287
+ # @type PromptTokens: Integer
288
+ # @param TotalTokens: 总Token数。
289
+ # @type TotalTokens: Integer
290
+
291
+ attr_accessor :PromptTokens, :TotalTokens
292
+
293
+ def initialize(prompttokens=nil, totaltokens=nil)
294
+ @PromptTokens = prompttokens
295
+ @TotalTokens = totaltokens
296
+ end
297
+
298
+ def deserialize(params)
299
+ @PromptTokens = params['PromptTokens']
300
+ @TotalTokens = params['TotalTokens']
301
+ end
302
+ end
303
+
257
304
  # 运行时异常信息。
258
305
  class ErrorMsg < TencentCloud::Common::AbstractModel
259
306
  # @param Msg: 错误提示信息。
@@ -276,6 +323,56 @@ module TencentCloud
276
323
  end
277
324
  end
278
325
 
326
+ # GetEmbedding请求参数结构体
327
+ class GetEmbeddingRequest < TencentCloud::Common::AbstractModel
328
+ # @param Input: 输入文本。总长度不超过1024 个token, 超过则会截断最后面的内容。
329
+ # @type Input: String
330
+
331
+ attr_accessor :Input
332
+
333
+ def initialize(input=nil)
334
+ @Input = input
335
+ end
336
+
337
+ def deserialize(params)
338
+ @Input = params['Input']
339
+ end
340
+ end
341
+
342
+ # GetEmbedding返回参数结构体
343
+ class GetEmbeddingResponse < TencentCloud::Common::AbstractModel
344
+ # @param Data: 返回的 embedding 信息。
345
+ # @type Data: Array
346
+ # @param Usage: token 使用计数,按照总token数量收费。
347
+ # @type Usage: :class:`Tencentcloud::Hunyuan.v20230901.models.EmbeddingUsage`
348
+ # @param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
349
+ # @type RequestId: String
350
+
351
+ attr_accessor :Data, :Usage, :RequestId
352
+
353
+ def initialize(data=nil, usage=nil, requestid=nil)
354
+ @Data = data
355
+ @Usage = usage
356
+ @RequestId = requestid
357
+ end
358
+
359
+ def deserialize(params)
360
+ unless params['Data'].nil?
361
+ @Data = []
362
+ params['Data'].each do |i|
363
+ embeddingdata_tmp = EmbeddingData.new
364
+ embeddingdata_tmp.deserialize(i)
365
+ @Data << embeddingdata_tmp
366
+ end
367
+ end
368
+ unless params['Usage'].nil?
369
+ @Usage = EmbeddingUsage.new
370
+ @Usage.deserialize(params['Usage'])
371
+ end
372
+ @RequestId = params['RequestId']
373
+ end
374
+ end
375
+
279
376
  # GetTokenCount请求参数结构体
280
377
  class GetTokenCountRequest < TencentCloud::Common::AbstractModel
281
378
  # @param Prompt: 输入文本
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-hunyuan
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.741
4
+ version: 3.0.742
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud