tencentcloud-sdk-hunyuan 3.0.952 → 3.0.953

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: bbb8c3c8e14e75c4022b1c346dfe985005728b13
4
- data.tar.gz: 8e3dd2fbdbc7c354fbdd5a337f8d8c8a73a5fd6d
3
+ metadata.gz: b5c7a18cbef36bfcbfb6f7e8621292d3813b5332
4
+ data.tar.gz: 12fcf09938bfb0be4960d910131b5836c212dd87
5
5
  SHA512:
6
- metadata.gz: 5ae2f5e83f9a8c27d1f5a9bdc41f66c7ce64a13e086fb3e385302cf95d92cb2e138369cca8e9d35abb80a9b458a844af2f11f576fb710720ac2d9f16f3a69a02
7
- data.tar.gz: 48ff616fe856f809abd547de94d915f858e0416a851f3986143afc8d25248eec7a7d7d2c29b8d87aafb6054d923aaa4f468fcdf8e799b12baf527ea9dd6bd8c3
6
+ metadata.gz: d332022b53d1b96c5c3aa1c8d571edad1622f4ed877488bb4df345538e7ef3703f2e443511608df7d6e11ce7fae4913aa81bf30cae3c230d0cc25d5aadca4b0c
7
+ data.tar.gz: ad7d50831e62e3e86cc1e2448c37aa7e899ecceecd1d3bd8b32de1ec022e8996615dfe3887a5fdc3f078ff51ef52466ce3a3d2cbb2e183d8054355b930c8513a
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.952
1
+ 3.0.953
@@ -89,6 +89,35 @@ module TencentCloud
89
89
  # 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。
90
90
  # 4. 我们推荐您使用 API Explorer,方便快速地在线调试接口和下载各语言的示例代码,[点击打开](https://console.cloud.tencent.com/api/explorer?Product=hunyuan&Version=2023-09-01&Action=ChatCompletions)。
91
91
 
92
+ # @param request: Request instance for ChatTranslations.
93
+ # @type request: :class:`Tencentcloud::hunyuan::V20230901::ChatTranslationsRequest`
94
+ # @rtype: :class:`Tencentcloud::hunyuan::V20230901::ChatTranslationsResponse`
95
+ def ChatTranslations(request)
96
+ body = send_request('ChatTranslations', request.serialize)
97
+ response = JSON.parse(body)
98
+ if response['Response'].key?('Error') == false
99
+ model = ChatTranslationsResponse.new
100
+ model.deserialize(response['Response'])
101
+ model
102
+ else
103
+ code = response['Response']['Error']['Code']
104
+ message = response['Response']['Error']['Message']
105
+ reqid = response['Response']['RequestId']
106
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
107
+ end
108
+ rescue TencentCloud::Common::TencentCloudSDKException => e
109
+ raise e
110
+ rescue StandardError => e
111
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
112
+ end
113
+
114
+ # 腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。
115
+
116
+ # 1. 本接口暂不支持返回图片内容。
117
+ # 2. 默认该接口下单账号限制并发数为 5 路,如您有提高并发限制的需求请 [购买](https://buy.cloud.tencent.com/hunyuan) 。
118
+ # 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。
119
+ # 4. 我们推荐您使用 API Explorer,方便快速地在线调试接口和下载各语言的示例代码,[点击打开](https://console.cloud.tencent.com/api/explorer?Product=hunyuan&Version=2023-09-01&Action=ChatCompletions)。
120
+
92
121
  # @param request: Request instance for CreateThread.
93
122
  # @type request: :class:`Tencentcloud::hunyuan::V20230901::CreateThreadRequest`
94
123
  # @rtype: :class:`Tencentcloud::hunyuan::V20230901::CreateThreadResponse`
@@ -134,10 +134,15 @@ module TencentCloud
134
134
  # @type EnableDeepSearch: Boolean
135
135
  # @param Seed: 说明: 1. 确保模型的输出是可复现的。 2. 取值区间为非0正整数,最大值10000。 3. 非必要不建议使用,不合理的取值会影响效果。
136
136
  # @type Seed: Integer
137
+ # @param ForceSearchEnhancement: 强制搜索增强开关。
138
+ # 说明:
139
+ # 1. 未传值时默认关闭。
140
+ # 2. 开启后,将强制走AI搜索,当AI搜索结果为空时,由大模型回复兜底话术。
141
+ # @type ForceSearchEnhancement: Boolean
137
142
 
138
- attr_accessor :Model, :Messages, :Stream, :StreamModeration, :TopP, :Temperature, :EnableEnhancement, :Tools, :ToolChoice, :CustomTool, :SearchInfo, :Citation, :EnableSpeedSearch, :EnableMultimedia, :EnableDeepSearch, :Seed
143
+ attr_accessor :Model, :Messages, :Stream, :StreamModeration, :TopP, :Temperature, :EnableEnhancement, :Tools, :ToolChoice, :CustomTool, :SearchInfo, :Citation, :EnableSpeedSearch, :EnableMultimedia, :EnableDeepSearch, :Seed, :ForceSearchEnhancement
139
144
 
140
- def initialize(model=nil, messages=nil, stream=nil, streammoderation=nil, topp=nil, temperature=nil, enableenhancement=nil, tools=nil, toolchoice=nil, customtool=nil, searchinfo=nil, citation=nil, enablespeedsearch=nil, enablemultimedia=nil, enabledeepsearch=nil, seed=nil)
145
+ def initialize(model=nil, messages=nil, stream=nil, streammoderation=nil, topp=nil, temperature=nil, enableenhancement=nil, tools=nil, toolchoice=nil, customtool=nil, searchinfo=nil, citation=nil, enablespeedsearch=nil, enablemultimedia=nil, enabledeepsearch=nil, seed=nil, forcesearchenhancement=nil)
141
146
  @Model = model
142
147
  @Messages = messages
143
148
  @Stream = stream
@@ -154,6 +159,7 @@ module TencentCloud
154
159
  @EnableMultimedia = enablemultimedia
155
160
  @EnableDeepSearch = enabledeepsearch
156
161
  @Seed = seed
162
+ @ForceSearchEnhancement = forcesearchenhancement
157
163
  end
158
164
 
159
165
  def deserialize(params)
@@ -190,6 +196,7 @@ module TencentCloud
190
196
  @EnableMultimedia = params['EnableMultimedia']
191
197
  @EnableDeepSearch = params['EnableDeepSearch']
192
198
  @Seed = params['Seed']
199
+ @ForceSearchEnhancement = params['ForceSearchEnhancement']
193
200
  end
194
201
  end
195
202
 
@@ -274,6 +281,124 @@ module TencentCloud
274
281
  end
275
282
  end
276
283
 
284
+ # ChatTranslations请求参数结构体
285
+ class ChatTranslationsRequest < TencentCloud::Common::AbstractModel
286
+ # @param Model: 模型名称,可选值包括 hunyuan-translation、hunyuan-translation-lite。
287
+ # 各模型介绍请阅读 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 中的说明。
288
+
289
+ # 注意:
290
+ # 不同的模型计费不同,请根据 [购买指南](https://cloud.tencent.com/document/product/1729/97731) 按需调用。
291
+ # @type Model: String
292
+ # @param Stream: 流式调用开关。
293
+ # 说明:
294
+ # 1. 未传值时默认为非流式调用(false)。
295
+ # 2. 流式调用时以 SSE 协议增量返回结果(返回值取 Choices[n].Delta 中的值,需要拼接增量数据才能获得完整结果)。
296
+ # 3. 非流式调用时:
297
+ # 调用方式与普通 HTTP 请求无异。
298
+ # 接口响应耗时较长,**如需更低时延建议设置为 true**。
299
+ # 只返回一次最终结果(返回值取 Choices[n].Message 中的值)。
300
+
301
+ # 注意:
302
+ # 通过 SDK 调用时,流式和非流式调用需用**不同的方式**获取返回值,具体参考 SDK 中的注释或示例(在各语言 SDK 代码仓库的 examples/hunyuan/v20230901/ 目录中)。
303
+ # @type Stream: Boolean
304
+ # @param Text: 待翻译的文本
305
+ # @type Text: String
306
+ # @param Source: 源语言。
307
+ # 支持语言列表: 1. 简体中文:zh,2. 粤语:yue,3. 英语:en,4. 法语:fr,5. 葡萄牙语:pt,6. 西班牙语:es,7. 日语:ja,8. 土耳其语:tr,9. 俄语:ru,10. 阿拉伯语:ar,11. 韩语:ko,12. 泰语:th,13. 意大利语:it,14. 德语:de,15. 越南语:vi,16. 马来语:ms,17. 印尼语:id
308
+ # @type Source: String
309
+ # @param Target: 目标语言。
310
+ # 支持语言列表: 1. 简体中文:zh,2. 粤语:yue,3. 英语:en,4. 法语:fr,5. 葡萄牙语:pt,6. 西班牙语:es,7. 日语:ja,8. 土耳其语:tr,9. 俄语:ru,10. 阿拉伯语:ar,11. 韩语:ko,12. 泰语:th,13. 意大利语:it,14. 德语:de,15. 越南语:vi,16. 马来语:ms,17. 印尼语:id
311
+ # @type Target: String
312
+ # @param Field: 待翻译文本所属领域,例如游戏剧情等
313
+ # @type Field: String
314
+ # @param References: 参考示例,最多10个
315
+ # @type References: Array
316
+
317
+ attr_accessor :Model, :Stream, :Text, :Source, :Target, :Field, :References
318
+
319
+ def initialize(model=nil, stream=nil, text=nil, source=nil, target=nil, field=nil, references=nil)
320
+ @Model = model
321
+ @Stream = stream
322
+ @Text = text
323
+ @Source = source
324
+ @Target = target
325
+ @Field = field
326
+ @References = references
327
+ end
328
+
329
+ def deserialize(params)
330
+ @Model = params['Model']
331
+ @Stream = params['Stream']
332
+ @Text = params['Text']
333
+ @Source = params['Source']
334
+ @Target = params['Target']
335
+ @Field = params['Field']
336
+ unless params['References'].nil?
337
+ @References = []
338
+ params['References'].each do |i|
339
+ reference_tmp = Reference.new
340
+ reference_tmp.deserialize(i)
341
+ @References << reference_tmp
342
+ end
343
+ end
344
+ end
345
+ end
346
+
347
+ # ChatTranslations返回参数结构体
348
+ class ChatTranslationsResponse < TencentCloud::Common::AbstractModel
349
+ # @param Id: 本次请求的 RequestId。
350
+ # @type Id: String
351
+ # @param Note: 免责声明。
352
+ # @type Note: String
353
+ # @param Created: Unix 时间戳,单位为秒。
354
+ # @type Created: Integer
355
+ # @param Usage: Token 统计信息。
356
+ # 按照总 Token 数量计费。
357
+ # @type Usage: :class:`Tencentcloud::Hunyuan.v20230901.models.Usage`
358
+ # @param Choices: 回复内容。
359
+ # @type Choices: Array
360
+ # @param ErrorMsg: 错误信息。
361
+ # 如果流式返回中服务处理异常,返回该错误信息。
362
+ # @type ErrorMsg: :class:`Tencentcloud::Hunyuan.v20230901.models.ErrorMsg`
363
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
364
+ # @type RequestId: String
365
+
366
+ attr_accessor :Id, :Note, :Created, :Usage, :Choices, :ErrorMsg, :RequestId
367
+
368
+ def initialize(id=nil, note=nil, created=nil, usage=nil, choices=nil, errormsg=nil, requestid=nil)
369
+ @Id = id
370
+ @Note = note
371
+ @Created = created
372
+ @Usage = usage
373
+ @Choices = choices
374
+ @ErrorMsg = errormsg
375
+ @RequestId = requestid
376
+ end
377
+
378
+ def deserialize(params)
379
+ @Id = params['Id']
380
+ @Note = params['Note']
381
+ @Created = params['Created']
382
+ unless params['Usage'].nil?
383
+ @Usage = Usage.new
384
+ @Usage.deserialize(params['Usage'])
385
+ end
386
+ unless params['Choices'].nil?
387
+ @Choices = []
388
+ params['Choices'].each do |i|
389
+ translationchoice_tmp = TranslationChoice.new
390
+ translationchoice_tmp.deserialize(i)
391
+ @Choices << translationchoice_tmp
392
+ end
393
+ end
394
+ unless params['ErrorMsg'].nil?
395
+ @ErrorMsg = ErrorMsg.new
396
+ @ErrorMsg.deserialize(params['ErrorMsg'])
397
+ end
398
+ @RequestId = params['RequestId']
399
+ end
400
+ end
401
+
277
402
  # 返回的回复, 支持多个
278
403
  class Choice < TencentCloud::Common::AbstractModel
279
404
  # @param FinishReason: 结束标志位,可能为 stop、 sensitive或者tool_calls。
@@ -1391,6 +1516,30 @@ module TencentCloud
1391
1516
  end
1392
1517
  end
1393
1518
 
1519
+ # 翻译对话参考示例
1520
+ class Reference < TencentCloud::Common::AbstractModel
1521
+ # @param Type: 翻译文本类型,枚举"sentence"表示句子, "term"表示术语
1522
+ # @type Type: String
1523
+ # @param Text: 原文
1524
+ # @type Text: String
1525
+ # @param Translation: 译文
1526
+ # @type Translation: String
1527
+
1528
+ attr_accessor :Type, :Text, :Translation
1529
+
1530
+ def initialize(type=nil, text=nil, translation=nil)
1531
+ @Type = type
1532
+ @Text = text
1533
+ @Translation = translation
1534
+ end
1535
+
1536
+ def deserialize(params)
1537
+ @Type = params['Type']
1538
+ @Text = params['Text']
1539
+ @Translation = params['Translation']
1540
+ end
1541
+ end
1542
+
1394
1543
  # 相关组织及人物
1395
1544
  class RelevantEntity < TencentCloud::Common::AbstractModel
1396
1545
  # @param Name: 相关组织及人物名称
@@ -1811,6 +1960,10 @@ module TencentCloud
1811
1960
  # 不传:随机种子生成。
1812
1961
  # 正数:固定种子生成。
1813
1962
  # @type Seed: Integer
1963
+ # @param Clarity: 超分选项,默认不做超分,可选开启。
1964
+ # x2:2倍超分
1965
+ # x4:4倍超分
1966
+ # @type Clarity: String
1814
1967
  # @param Revise: prompt 扩写开关。1为开启,0为关闭,不传默认开启。
1815
1968
  # 开启扩写后,将自动扩写原始输入的 prompt 并使用扩写后的 prompt 生成图片,返回生成图片结果时将一并返回扩写后的 prompt 文本。
1816
1969
  # 如果关闭扩写,将直接使用原始输入的 prompt 生成图片。
@@ -1826,15 +1979,16 @@ module TencentCloud
1826
1979
  # 默认在生成结果图右下角添加“图片由 AI 生成”字样,您可根据自身需要替换为其他的标识图片。
1827
1980
  # @type LogoParam: :class:`Tencentcloud::Hunyuan.v20230901.models.LogoParam`
1828
1981
 
1829
- attr_accessor :Prompt, :NegativePrompt, :Style, :Resolution, :Num, :Seed, :Revise, :LogoAdd, :LogoParam
1982
+ attr_accessor :Prompt, :NegativePrompt, :Style, :Resolution, :Num, :Seed, :Clarity, :Revise, :LogoAdd, :LogoParam
1830
1983
 
1831
- def initialize(prompt=nil, negativeprompt=nil, style=nil, resolution=nil, num=nil, seed=nil, revise=nil, logoadd=nil, logoparam=nil)
1984
+ def initialize(prompt=nil, negativeprompt=nil, style=nil, resolution=nil, num=nil, seed=nil, clarity=nil, revise=nil, logoadd=nil, logoparam=nil)
1832
1985
  @Prompt = prompt
1833
1986
  @NegativePrompt = negativeprompt
1834
1987
  @Style = style
1835
1988
  @Resolution = resolution
1836
1989
  @Num = num
1837
1990
  @Seed = seed
1991
+ @Clarity = clarity
1838
1992
  @Revise = revise
1839
1993
  @LogoAdd = logoadd
1840
1994
  @LogoParam = logoparam
@@ -1847,6 +2001,7 @@ module TencentCloud
1847
2001
  @Resolution = params['Resolution']
1848
2002
  @Num = params['Num']
1849
2003
  @Seed = params['Seed']
2004
+ @Clarity = params['Clarity']
1850
2005
  @Revise = params['Revise']
1851
2006
  @LogoAdd = params['LogoAdd']
1852
2007
  unless params['LogoParam'].nil?
@@ -2242,6 +2397,82 @@ module TencentCloud
2242
2397
  end
2243
2398
  end
2244
2399
 
2400
+ # 翻译接口返回的回复,支持多个
2401
+ class TranslationChoice < TencentCloud::Common::AbstractModel
2402
+ # @param FinishReason: 结束标志位,可能为 stop、 sensitive。
2403
+ # stop 表示输出正常结束。
2404
+ # sensitive 只在开启流式输出审核时会出现,表示安全审核未通过。
2405
+ # @type FinishReason: String
2406
+ # @param Index: 索引值,流式调用时使用该字段。
2407
+ # @type Index: Integer
2408
+ # @param Delta: 增量返回值,流式调用时使用该字段。
2409
+ # @type Delta: :class:`Tencentcloud::Hunyuan.v20230901.models.TranslationDelta`
2410
+ # @param Message: 返回值,非流式调用时使用该字段。
2411
+ # @type Message: :class:`Tencentcloud::Hunyuan.v20230901.models.TranslationMessage`
2412
+
2413
+ attr_accessor :FinishReason, :Index, :Delta, :Message
2414
+
2415
+ def initialize(finishreason=nil, index=nil, delta=nil, message=nil)
2416
+ @FinishReason = finishreason
2417
+ @Index = index
2418
+ @Delta = delta
2419
+ @Message = message
2420
+ end
2421
+
2422
+ def deserialize(params)
2423
+ @FinishReason = params['FinishReason']
2424
+ @Index = params['Index']
2425
+ unless params['Delta'].nil?
2426
+ @Delta = TranslationDelta.new
2427
+ @Delta.deserialize(params['Delta'])
2428
+ end
2429
+ unless params['Message'].nil?
2430
+ @Message = TranslationMessage.new
2431
+ @Message.deserialize(params['Message'])
2432
+ end
2433
+ end
2434
+ end
2435
+
2436
+ # 翻译接口返回的内容(流式返回)
2437
+ class TranslationDelta < TencentCloud::Common::AbstractModel
2438
+ # @param Role: 角色名称。
2439
+ # @type Role: String
2440
+ # @param Content: 内容详情。
2441
+ # @type Content: String
2442
+
2443
+ attr_accessor :Role, :Content
2444
+
2445
+ def initialize(role=nil, content=nil)
2446
+ @Role = role
2447
+ @Content = content
2448
+ end
2449
+
2450
+ def deserialize(params)
2451
+ @Role = params['Role']
2452
+ @Content = params['Content']
2453
+ end
2454
+ end
2455
+
2456
+ # 翻译接口会话内容
2457
+ class TranslationMessage < TencentCloud::Common::AbstractModel
2458
+ # @param Role: 角色,可选值包括 system、user、assistant、 tool。
2459
+ # @type Role: String
2460
+ # @param Content: 文本内容
2461
+ # @type Content: String
2462
+
2463
+ attr_accessor :Role, :Content
2464
+
2465
+ def initialize(role=nil, content=nil)
2466
+ @Role = role
2467
+ @Content = content
2468
+ end
2469
+
2470
+ def deserialize(params)
2471
+ @Role = params['Role']
2472
+ @Content = params['Content']
2473
+ end
2474
+ end
2475
+
2245
2476
  # Token 数量
2246
2477
  class Usage < TencentCloud::Common::AbstractModel
2247
2478
  # @param PromptTokens: 输入 Token 数量。
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tencentcloud-sdk-hunyuan
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.952
4
+ version: 3.0.953
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tencent Cloud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-01 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common