tencentcloud-sdk-hunyuan 3.0.1055 → 3.0.1056

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: 05dd81d5b1b41707ec7b602337607c8b01ebfdee
4
- data.tar.gz: bd1b642d1f6547a85dfa915c8e34012c3599dc60
3
+ metadata.gz: 1ffc22b75ae7ecb450bc06fe098bafab5c355d37
4
+ data.tar.gz: d449e22f7d0bafb0ece3dd01410cbe19359a226e
5
5
  SHA512:
6
- metadata.gz: 9e38d52650d51680e26285111d197827abd29911668863972adc2a3ea0116cb8d2b239375c9300bc6ecb93d956345db29b2e27478f90ae583f9ed44ae04f644d
7
- data.tar.gz: 20395e70e7ac98d4e7df630ac1b0fb7fe3f3f0975414bbadeb96185582c310b918c29963ad4f35c9ac27012be188de401941b825c2bcfe88837367b0263b1165
6
+ metadata.gz: 5ead8323528ad1d643ee9c42fdd4b20d6836eb0b5f0a0bf61bedaaa9c96bba6abe11d807ef082bf078935a55fcfca619e78508809c68aa3e8153a2973671d163
7
+ data.tar.gz: 7c013c8af6b99d65687beba22a407b471f59d4a9e01a68fb0cd62e17ad38b7938042e9a0810751f86d747a3fa2c1afeaa6089470b7437dbb079156b95c4a208d
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.1055
1
+ 3.0.1056
@@ -381,6 +381,37 @@ module TencentCloud
381
381
  raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
382
382
  end
383
383
 
384
+ # 如需使用OpenAI兼容接口, 请参考文档:[OpenAI 兼容接口](https://cloud.tencent.com/document/product/1729/111007)
385
+
386
+ # 腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。
387
+
388
+ # 1. 本接口暂不支持返回图片内容。
389
+ # 2. 默认该接口下单账号限制并发数为 5 路,如您有提高并发限制的需求请 [购买](https://buy.cloud.tencent.com/hunyuan) 。
390
+ # 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。
391
+ # 4. 我们推荐您使用 API Explorer,方便快速地在线调试接口和下载各语言的示例代码,[点击打开](https://console.cloud.tencent.com/api/explorer?Product=hunyuan&Version=2023-09-01&Action=ChatCompletions)。
392
+
393
+ # @param request: Request instance for ImageQuestion.
394
+ # @type request: :class:`Tencentcloud::hunyuan::V20230901::ImageQuestionRequest`
395
+ # @rtype: :class:`Tencentcloud::hunyuan::V20230901::ImageQuestionResponse`
396
+ def ImageQuestion(request)
397
+ body = send_request('ImageQuestion', request.serialize)
398
+ response = JSON.parse(body)
399
+ if response['Response'].key?('Error') == false
400
+ model = ImageQuestionResponse.new
401
+ model.deserialize(response['Response'])
402
+ model
403
+ else
404
+ code = response['Response']['Error']['Code']
405
+ message = response['Response']['Error']['Message']
406
+ reqid = response['Response']['RequestId']
407
+ raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
408
+ end
409
+ rescue TencentCloud::Common::TencentCloudSDKException => e
410
+ raise e
411
+ rescue StandardError => e
412
+ raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
413
+ end
414
+
384
415
  # 混元生图(多轮对话)接口基于混元大模型,将根据输入的文本描述生成图像,支持通过多轮对话的方式不断调整图像内容。分为提交任务和查询任务2个接口。
385
416
  # 提交任务:输入文本和前置对话 ID 等,提交一个混元生图多轮对话异步任务,获得任务 ID。
386
417
  # 查询任务:根据任务 ID 查询任务的处理状态、处理结果,任务处理完成后可获得在上一轮对话基础上继续生成的图像结果。
@@ -268,8 +268,8 @@ module TencentCloud
268
268
 
269
269
  attr_accessor :Created, :Usage, :Note, :Id, :Choices, :ErrorMsg, :ModerationLevel, :SearchInfo, :Replaces, :RecommendedQuestions, :RequestId
270
270
  extend Gem::Deprecate
271
- deprecate :ModerationLevel, :none, 2025, 4
272
- deprecate :ModerationLevel=, :none, 2025, 4
271
+ deprecate :ModerationLevel, :none, 2025, 5
272
+ deprecate :ModerationLevel=, :none, 2025, 5
273
273
 
274
274
  def initialize(created=nil, usage=nil, note=nil, id=nil, choices=nil, errormsg=nil, moderationlevel=nil, searchinfo=nil, replaces=nil, recommendedquestions=nil, requestid=nil)
275
275
  @Created = created
@@ -577,13 +577,16 @@ module TencentCloud
577
577
 
578
578
  # 注意:此字段可能返回 null,表示取不到有效值。
579
579
  # @type ToolCalls: Array
580
+ # @param ReasoningContent: 思维链内容。用于展示模型思考过程,仅 Hunyuan-T1 系列模型可用。注意:在进行多轮对话时,请不要将此字段拼接到 messages 中。请求 messages 的请求参数中包含 reasoning_content,接口将报错。
581
+ # @type ReasoningContent: String
580
582
 
581
- attr_accessor :Role, :Content, :ToolCalls
583
+ attr_accessor :Role, :Content, :ToolCalls, :ReasoningContent
582
584
 
583
- def initialize(role=nil, content=nil, toolcalls=nil)
585
+ def initialize(role=nil, content=nil, toolcalls=nil, reasoningcontent=nil)
584
586
  @Role = role
585
587
  @Content = content
586
588
  @ToolCalls = toolcalls
589
+ @ReasoningContent = reasoningcontent
587
590
  end
588
591
 
589
592
  def deserialize(params)
@@ -597,6 +600,7 @@ module TencentCloud
597
600
  @ToolCalls << toolcall_tmp
598
601
  end
599
602
  end
603
+ @ReasoningContent = params['ReasoningContent']
600
604
  end
601
605
  end
602
606
 
@@ -1008,10 +1012,10 @@ module TencentCloud
1008
1012
 
1009
1013
  attr_accessor :Data, :FirstID, :LastID, :HasMore, :Object, :FirstMsgID, :LastMsgID, :RequestId
1010
1014
  extend Gem::Deprecate
1011
- deprecate :FirstID, :none, 2025, 4
1012
- deprecate :FirstID=, :none, 2025, 4
1013
- deprecate :LastID, :none, 2025, 4
1014
- deprecate :LastID=, :none, 2025, 4
1015
+ deprecate :FirstID, :none, 2025, 5
1016
+ deprecate :FirstID=, :none, 2025, 5
1017
+ deprecate :LastID, :none, 2025, 5
1018
+ deprecate :LastID=, :none, 2025, 5
1015
1019
 
1016
1020
  def initialize(data=nil, firstid=nil, lastid=nil, hasmore=nil, object=nil, firstmsgid=nil, lastmsgid=nil, requestid=nil)
1017
1021
  @Data = data
@@ -1491,6 +1495,134 @@ module TencentCloud
1491
1495
  end
1492
1496
  end
1493
1497
 
1498
+ # 拍照解题内容
1499
+ class ImageMessage < TencentCloud::Common::AbstractModel
1500
+ # @param Role: 角色,可选值包括 system、user、assistant。
1501
+ # @type Role: String
1502
+ # @param Content: 文本内容
1503
+ # @type Content: String
1504
+ # @param Contents: 多种类型内容(目前支持图片和文本),仅 hunyuan-vision 和 hunyuan-turbo-vision 模型支持
1505
+ # @type Contents: Array
1506
+
1507
+ attr_accessor :Role, :Content, :Contents
1508
+
1509
+ def initialize(role=nil, content=nil, contents=nil)
1510
+ @Role = role
1511
+ @Content = content
1512
+ @Contents = contents
1513
+ end
1514
+
1515
+ def deserialize(params)
1516
+ @Role = params['Role']
1517
+ @Content = params['Content']
1518
+ unless params['Contents'].nil?
1519
+ @Contents = []
1520
+ params['Contents'].each do |i|
1521
+ content_tmp = Content.new
1522
+ content_tmp.deserialize(i)
1523
+ @Contents << content_tmp
1524
+ end
1525
+ end
1526
+ end
1527
+ end
1528
+
1529
+ # ImageQuestion请求参数结构体
1530
+ class ImageQuestionRequest < TencentCloud::Common::AbstractModel
1531
+ # @param Model: 模型名称,可选值包括 hunyuan-vision-image-question。各模型介绍请阅读 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 中的说明。注意:不同的模型计费不同,请根据 [购买指南](https://cloud.tencent.com/document/product/1729/97731) 按需调用。
1532
+ # @type Model: String
1533
+ # @param Messages: 聊天上下文信息。说明:1. 长度最多为 40,按对话时间从旧到新在数组中排列。2. Message.Role 可选值:system、user、assistant。其中,system 角色可选,如存在则必须位于列表的最开始。user 和 assistant 需交替出现(一问一答),以 user 提问开始,user提问结束,且 Content 不能为空。Role 的顺序示例:[system(可选) user assistant user assistant user ...]。3. Messages 中 Content 总长度不能超过模型输入长度上限(可参考 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 文档),超过则会截断最前面的内容,只保留尾部内容。
1534
+ # @type Messages: Array
1535
+ # @param Stream: 流式调用开关。
1536
+ # 说明:
1537
+ # 1. 未传值时默认为非流式调用(false)。
1538
+ # 2. 流式调用时以 SSE 协议增量返回结果(返回值取 Choices[n].Delta 中的值,需要拼接增量数据才能获得完整结果)。
1539
+ # 3. 非流式调用时:
1540
+ # 调用方式与普通 HTTP 请求无异。
1541
+ # 接口响应耗时较长,**如需更低时延建议设置为 true**。
1542
+ # 只返回一次最终结果(返回值取 Choices[n].Message 中的值)。
1543
+
1544
+ # 注意:
1545
+ # 通过 SDK 调用时,流式和非流式调用需用**不同的方式**获取返回值,具体参考 SDK 中的注释或示例(在各语言 SDK 代码仓库的 examples/hunyuan/v20230901/ 目录中)。
1546
+ # @type Stream: Boolean
1547
+
1548
+ attr_accessor :Model, :Messages, :Stream
1549
+
1550
+ def initialize(model=nil, messages=nil, stream=nil)
1551
+ @Model = model
1552
+ @Messages = messages
1553
+ @Stream = stream
1554
+ end
1555
+
1556
+ def deserialize(params)
1557
+ @Model = params['Model']
1558
+ unless params['Messages'].nil?
1559
+ @Messages = []
1560
+ params['Messages'].each do |i|
1561
+ imagemessage_tmp = ImageMessage.new
1562
+ imagemessage_tmp.deserialize(i)
1563
+ @Messages << imagemessage_tmp
1564
+ end
1565
+ end
1566
+ @Stream = params['Stream']
1567
+ end
1568
+ end
1569
+
1570
+ # ImageQuestion返回参数结构体
1571
+ class ImageQuestionResponse < TencentCloud::Common::AbstractModel
1572
+ # @param Created: Unix 时间戳,单位为秒。
1573
+ # @type Created: Integer
1574
+ # @param Usage: Token 统计信息。
1575
+ # 按照总 Token 数量计费。
1576
+ # @type Usage: :class:`Tencentcloud::Hunyuan.v20230901.models.Usage`
1577
+ # @param Note: 免责声明。
1578
+ # @type Note: String
1579
+ # @param Id: 本次请求的 RequestId。
1580
+ # @type Id: String
1581
+ # @param Choices: 回复内容。
1582
+ # @type Choices: Array
1583
+ # @param ErrorMsg: 错误信息。
1584
+ # 如果流式返回中服务处理异常,返回该错误信息。
1585
+ # 注意:此字段可能返回 null,表示取不到有效值。
1586
+ # @type ErrorMsg: :class:`Tencentcloud::Hunyuan.v20230901.models.ErrorMsg`
1587
+ # @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
1588
+ # @type RequestId: String
1589
+
1590
+ attr_accessor :Created, :Usage, :Note, :Id, :Choices, :ErrorMsg, :RequestId
1591
+
1592
+ def initialize(created=nil, usage=nil, note=nil, id=nil, choices=nil, errormsg=nil, requestid=nil)
1593
+ @Created = created
1594
+ @Usage = usage
1595
+ @Note = note
1596
+ @Id = id
1597
+ @Choices = choices
1598
+ @ErrorMsg = errormsg
1599
+ @RequestId = requestid
1600
+ end
1601
+
1602
+ def deserialize(params)
1603
+ @Created = params['Created']
1604
+ unless params['Usage'].nil?
1605
+ @Usage = Usage.new
1606
+ @Usage.deserialize(params['Usage'])
1607
+ end
1608
+ @Note = params['Note']
1609
+ @Id = params['Id']
1610
+ unless params['Choices'].nil?
1611
+ @Choices = []
1612
+ params['Choices'].each do |i|
1613
+ choice_tmp = Choice.new
1614
+ choice_tmp.deserialize(i)
1615
+ @Choices << choice_tmp
1616
+ end
1617
+ end
1618
+ unless params['ErrorMsg'].nil?
1619
+ @ErrorMsg = ErrorMsg.new
1620
+ @ErrorMsg.deserialize(params['ErrorMsg'])
1621
+ end
1622
+ @RequestId = params['RequestId']
1623
+ end
1624
+ end
1625
+
1494
1626
  # 具体的图片内容
1495
1627
  class ImageUrl < TencentCloud::Common::AbstractModel
1496
1628
  # @param Url: 图片的 Url(以 http:// 或 https:// 开头)
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.1055
4
+ version: 3.0.1056
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-08 00:00:00.000000000 Z
11
+ date: 2025-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tencentcloud-sdk-common