tencentcloud-sdk-hunyuan 3.0.857 → 3.0.858
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/v20230901/models.rb +223 -10
- 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: b0b8e2581c3b7e7b453b6af2c44fd56e099cd829
|
4
|
+
data.tar.gz: b1d3fab69f45827ccc37ae92498e0f1fc1dfebae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0483fe519afaab1d434791ffadc4e58874d5705d42a7120cf459252eaccf261255d59ccef55f42fc432e5d844f60ab7efed1addd286cbf6ca21478f2bd54625f
|
7
|
+
data.tar.gz: 02737cb190aba09076ce1adfc76a082513d7612b484a4c6f20b9075c709d22a2ba435e6cd4cff7454379fa63400578e7bf2def3930d8de99cc2b2a37ec289167
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.858
|
data/lib/v20230901/models.rb
CHANGED
@@ -19,7 +19,7 @@ module TencentCloud
|
|
19
19
|
module V20230901
|
20
20
|
# ChatCompletions请求参数结构体
|
21
21
|
class ChatCompletionsRequest < TencentCloud::Common::AbstractModel
|
22
|
-
# @param Model: 模型名称,可选值包括 hunyuan-lite、hunyuan-standard、hunyuan-standard-256K、hunyuan-pro。
|
22
|
+
# @param Model: 模型名称,可选值包括 hunyuan-lite、hunyuan-standard、hunyuan-standard-256K、hunyuan-pro、 hunyuan-code、 hunyuan-role、 hunyuan-functioncall、 hunyuan-vision。
|
23
23
|
# 各模型介绍请阅读 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 中的说明。
|
24
24
|
|
25
25
|
# 注意:
|
@@ -28,8 +28,8 @@ module TencentCloud
|
|
28
28
|
# @param Messages: 聊天上下文信息。
|
29
29
|
# 说明:
|
30
30
|
# 1. 长度最多为 40,按对话时间从旧到新在数组中排列。
|
31
|
-
# 2. Message.Role 可选值:system、user、assistant。
|
32
|
-
# 其中,system 角色可选,如存在则必须位于列表的最开始。user 和 assistant 需交替出现(一问一答),以 user
|
31
|
+
# 2. Message.Role 可选值:system、user、assistant、 tool。
|
32
|
+
# 其中,system 角色可选,如存在则必须位于列表的最开始。user(tool) 和 assistant 需交替出现(一问一答),以 user 提问开始,user(tool)提问结束,且 Content 不能为空。Role 的顺序示例:[system(可选) user assistant user assistant user ...]。
|
33
33
|
# 3. Messages 中 Content 总长度不能超过模型输入长度上限(可参考 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 文档),超过则会截断最前面的内容,只保留尾部内容。
|
34
34
|
# @type Messages: Array
|
35
35
|
# @param Stream: 流式调用开关。
|
@@ -71,10 +71,20 @@ module TencentCloud
|
|
71
71
|
# 3. 关闭时将直接由主模型生成回复内容,可以降低响应时延(对于流式输出时的首字时延尤为明显)。但在少数场景里,回复效果可能会下降。
|
72
72
|
# 4. 安全审核能力不属于功能增强范围,不受此字段影响。
|
73
73
|
# @type EnableEnhancement: Boolean
|
74
|
+
# @param Tools: 可调用的工具列表,仅对 hunyuan-functioncall 模型生效。
|
75
|
+
# @type Tools: Array
|
76
|
+
# @param ToolChoice: 工具使用选项,可选值包括 none、auto、custom。
|
77
|
+
# 说明:
|
78
|
+
# 1. 仅对 hunyuan-functioncall 模型生效。
|
79
|
+
# 2. none:不调用工具;auto:模型自行选择生成回复或调用工具;custom:强制模型调用指定的工具。
|
80
|
+
# 3. 未设置时,默认值为auto
|
81
|
+
# @type ToolChoice: String
|
82
|
+
# @param CustomTool: 强制模型调用指定的工具,当参数ToolChoice为custom时,此参数为必填
|
83
|
+
# @type CustomTool: :class:`Tencentcloud::Hunyuan.v20230901.models.Tool`
|
74
84
|
|
75
|
-
attr_accessor :Model, :Messages, :Stream, :StreamModeration, :TopP, :Temperature, :EnableEnhancement
|
85
|
+
attr_accessor :Model, :Messages, :Stream, :StreamModeration, :TopP, :Temperature, :EnableEnhancement, :Tools, :ToolChoice, :CustomTool
|
76
86
|
|
77
|
-
def initialize(model=nil, messages=nil, stream=nil, streammoderation=nil, topp=nil, temperature=nil, enableenhancement=nil)
|
87
|
+
def initialize(model=nil, messages=nil, stream=nil, streammoderation=nil, topp=nil, temperature=nil, enableenhancement=nil, tools=nil, toolchoice=nil, customtool=nil)
|
78
88
|
@Model = model
|
79
89
|
@Messages = messages
|
80
90
|
@Stream = stream
|
@@ -82,6 +92,9 @@ module TencentCloud
|
|
82
92
|
@TopP = topp
|
83
93
|
@Temperature = temperature
|
84
94
|
@EnableEnhancement = enableenhancement
|
95
|
+
@Tools = tools
|
96
|
+
@ToolChoice = toolchoice
|
97
|
+
@CustomTool = customtool
|
85
98
|
end
|
86
99
|
|
87
100
|
def deserialize(params)
|
@@ -99,6 +112,19 @@ module TencentCloud
|
|
99
112
|
@TopP = params['TopP']
|
100
113
|
@Temperature = params['Temperature']
|
101
114
|
@EnableEnhancement = params['EnableEnhancement']
|
115
|
+
unless params['Tools'].nil?
|
116
|
+
@Tools = []
|
117
|
+
params['Tools'].each do |i|
|
118
|
+
tool_tmp = Tool.new
|
119
|
+
tool_tmp.deserialize(i)
|
120
|
+
@Tools << tool_tmp
|
121
|
+
end
|
122
|
+
end
|
123
|
+
@ToolChoice = params['ToolChoice']
|
124
|
+
unless params['CustomTool'].nil?
|
125
|
+
@CustomTool = Tool.new
|
126
|
+
@CustomTool.deserialize(params['CustomTool'])
|
127
|
+
end
|
102
128
|
end
|
103
129
|
end
|
104
130
|
|
@@ -191,23 +217,70 @@ module TencentCloud
|
|
191
217
|
end
|
192
218
|
end
|
193
219
|
|
220
|
+
# 可以传入多种类型的内容,如图片或文本。当前只支持传入单张图片,传入多张图片时,以第一个图片为准。
|
221
|
+
class Content < TencentCloud::Common::AbstractModel
|
222
|
+
# @param Type: 内容类型
|
223
|
+
# 注意:
|
224
|
+
# 当前只支持传入单张图片,传入多张图片时,以第一个图片为准。
|
225
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
226
|
+
# @type Type: String
|
227
|
+
# @param Text: 当 Type 为 text 时使用,表示具体的文本内容
|
228
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
229
|
+
# @type Text: String
|
230
|
+
# @param ImageUrl: 当 Type 为 image_url 时使用,表示具体的图片内容
|
231
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
232
|
+
# @type ImageUrl: :class:`Tencentcloud::Hunyuan.v20230901.models.ImageUrl`
|
233
|
+
|
234
|
+
attr_accessor :Type, :Text, :ImageUrl
|
235
|
+
|
236
|
+
def initialize(type=nil, text=nil, imageurl=nil)
|
237
|
+
@Type = type
|
238
|
+
@Text = text
|
239
|
+
@ImageUrl = imageurl
|
240
|
+
end
|
241
|
+
|
242
|
+
def deserialize(params)
|
243
|
+
@Type = params['Type']
|
244
|
+
@Text = params['Text']
|
245
|
+
unless params['ImageUrl'].nil?
|
246
|
+
@ImageUrl = ImageUrl.new
|
247
|
+
@ImageUrl.deserialize(params['ImageUrl'])
|
248
|
+
end
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
194
252
|
# 返回的内容(流式返回)
|
195
253
|
class Delta < TencentCloud::Common::AbstractModel
|
196
254
|
# @param Role: 角色名称。
|
197
255
|
# @type Role: String
|
198
256
|
# @param Content: 内容详情。
|
199
257
|
# @type Content: String
|
258
|
+
# @param ToolCalls: 模型生成的工具调用,仅 hunyuan-functioncall 模型支持
|
259
|
+
# 说明:
|
260
|
+
# 对于每一次的输出值应该以Id为标识对Type、Name、Arguments字段进行合并。
|
261
|
+
|
262
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
263
|
+
# @type ToolCalls: Array
|
200
264
|
|
201
|
-
attr_accessor :Role, :Content
|
265
|
+
attr_accessor :Role, :Content, :ToolCalls
|
202
266
|
|
203
|
-
def initialize(role=nil, content=nil)
|
267
|
+
def initialize(role=nil, content=nil, toolcalls=nil)
|
204
268
|
@Role = role
|
205
269
|
@Content = content
|
270
|
+
@ToolCalls = toolcalls
|
206
271
|
end
|
207
272
|
|
208
273
|
def deserialize(params)
|
209
274
|
@Role = params['Role']
|
210
275
|
@Content = params['Content']
|
276
|
+
unless params['ToolCalls'].nil?
|
277
|
+
@ToolCalls = []
|
278
|
+
params['ToolCalls'].each do |i|
|
279
|
+
toolcall_tmp = ToolCall.new
|
280
|
+
toolcall_tmp.deserialize(i)
|
281
|
+
@ToolCalls << toolcall_tmp
|
282
|
+
end
|
283
|
+
end
|
211
284
|
end
|
212
285
|
end
|
213
286
|
|
@@ -374,23 +447,69 @@ module TencentCloud
|
|
374
447
|
end
|
375
448
|
end
|
376
449
|
|
450
|
+
# 具体的图片内容
|
451
|
+
class ImageUrl < TencentCloud::Common::AbstractModel
|
452
|
+
# @param Url: 图片的 Url(以 http:// 或 https:// 开头)
|
453
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
454
|
+
# @type Url: String
|
455
|
+
|
456
|
+
attr_accessor :Url
|
457
|
+
|
458
|
+
def initialize(url=nil)
|
459
|
+
@Url = url
|
460
|
+
end
|
461
|
+
|
462
|
+
def deserialize(params)
|
463
|
+
@Url = params['Url']
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
377
467
|
# 会话内容
|
378
468
|
class Message < TencentCloud::Common::AbstractModel
|
379
|
-
# @param Role: 角色,可选值包括 system、user、assistant。
|
469
|
+
# @param Role: 角色,可选值包括 system、user、assistant、 tool。
|
380
470
|
# @type Role: String
|
381
471
|
# @param Content: 文本内容
|
382
472
|
# @type Content: String
|
473
|
+
# @param Contents: 多种类型内容(目前支持图片和文本),仅 hunyuan-vision 模型支持
|
474
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
475
|
+
# @type Contents: Array
|
476
|
+
# @param ToolCallId: 当role为tool时传入,标识具体的函数调用
|
477
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
478
|
+
# @type ToolCallId: String
|
479
|
+
# @param ToolCalls: 模型生成的工具调用,仅 hunyuan-functioncall 模型支持
|
480
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
481
|
+
# @type ToolCalls: Array
|
383
482
|
|
384
|
-
attr_accessor :Role, :Content
|
483
|
+
attr_accessor :Role, :Content, :Contents, :ToolCallId, :ToolCalls
|
385
484
|
|
386
|
-
def initialize(role=nil, content=nil)
|
485
|
+
def initialize(role=nil, content=nil, contents=nil, toolcallid=nil, toolcalls=nil)
|
387
486
|
@Role = role
|
388
487
|
@Content = content
|
488
|
+
@Contents = contents
|
489
|
+
@ToolCallId = toolcallid
|
490
|
+
@ToolCalls = toolcalls
|
389
491
|
end
|
390
492
|
|
391
493
|
def deserialize(params)
|
392
494
|
@Role = params['Role']
|
393
495
|
@Content = params['Content']
|
496
|
+
unless params['Contents'].nil?
|
497
|
+
@Contents = []
|
498
|
+
params['Contents'].each do |i|
|
499
|
+
content_tmp = Content.new
|
500
|
+
content_tmp.deserialize(i)
|
501
|
+
@Contents << content_tmp
|
502
|
+
end
|
503
|
+
end
|
504
|
+
@ToolCallId = params['ToolCallId']
|
505
|
+
unless params['ToolCalls'].nil?
|
506
|
+
@ToolCalls = []
|
507
|
+
params['ToolCalls'].each do |i|
|
508
|
+
toolcall_tmp = ToolCall.new
|
509
|
+
toolcall_tmp.deserialize(i)
|
510
|
+
@ToolCalls << toolcall_tmp
|
511
|
+
end
|
512
|
+
end
|
394
513
|
end
|
395
514
|
end
|
396
515
|
|
@@ -517,6 +636,100 @@ module TencentCloud
|
|
517
636
|
end
|
518
637
|
end
|
519
638
|
|
639
|
+
# 用户指定模型使用的工具
|
640
|
+
class Tool < TencentCloud::Common::AbstractModel
|
641
|
+
# @param Type: 工具类型,当前只支持function
|
642
|
+
# @type Type: String
|
643
|
+
# @param Function: 具体要调用的function
|
644
|
+
# @type Function: :class:`Tencentcloud::Hunyuan.v20230901.models.ToolFunction`
|
645
|
+
|
646
|
+
attr_accessor :Type, :Function
|
647
|
+
|
648
|
+
def initialize(type=nil, function=nil)
|
649
|
+
@Type = type
|
650
|
+
@Function = function
|
651
|
+
end
|
652
|
+
|
653
|
+
def deserialize(params)
|
654
|
+
@Type = params['Type']
|
655
|
+
unless params['Function'].nil?
|
656
|
+
@Function = ToolFunction.new
|
657
|
+
@Function.deserialize(params['Function'])
|
658
|
+
end
|
659
|
+
end
|
660
|
+
end
|
661
|
+
|
662
|
+
# 模型生成的工具调用
|
663
|
+
class ToolCall < TencentCloud::Common::AbstractModel
|
664
|
+
# @param Id: 工具调用id
|
665
|
+
# @type Id: String
|
666
|
+
# @param Type: 工具调用类型,当前只支持function
|
667
|
+
# @type Type: String
|
668
|
+
# @param Function: 具体的function调用
|
669
|
+
# @type Function: :class:`Tencentcloud::Hunyuan.v20230901.models.ToolCallFunction`
|
670
|
+
|
671
|
+
attr_accessor :Id, :Type, :Function
|
672
|
+
|
673
|
+
def initialize(id=nil, type=nil, function=nil)
|
674
|
+
@Id = id
|
675
|
+
@Type = type
|
676
|
+
@Function = function
|
677
|
+
end
|
678
|
+
|
679
|
+
def deserialize(params)
|
680
|
+
@Id = params['Id']
|
681
|
+
@Type = params['Type']
|
682
|
+
unless params['Function'].nil?
|
683
|
+
@Function = ToolCallFunction.new
|
684
|
+
@Function.deserialize(params['Function'])
|
685
|
+
end
|
686
|
+
end
|
687
|
+
end
|
688
|
+
|
689
|
+
# 具体的function调用
|
690
|
+
class ToolCallFunction < TencentCloud::Common::AbstractModel
|
691
|
+
# @param Name: function名称
|
692
|
+
# @type Name: String
|
693
|
+
# @param Arguments: function参数,一般为json字符串
|
694
|
+
# @type Arguments: String
|
695
|
+
|
696
|
+
attr_accessor :Name, :Arguments
|
697
|
+
|
698
|
+
def initialize(name=nil, arguments=nil)
|
699
|
+
@Name = name
|
700
|
+
@Arguments = arguments
|
701
|
+
end
|
702
|
+
|
703
|
+
def deserialize(params)
|
704
|
+
@Name = params['Name']
|
705
|
+
@Arguments = params['Arguments']
|
706
|
+
end
|
707
|
+
end
|
708
|
+
|
709
|
+
# function定义
|
710
|
+
class ToolFunction < TencentCloud::Common::AbstractModel
|
711
|
+
# @param Name: function名称,只能包含a-z,A-Z,0-9,\_或-
|
712
|
+
# @type Name: String
|
713
|
+
# @param Parameters: function参数,一般为json字符串
|
714
|
+
# @type Parameters: String
|
715
|
+
# @param Description: function的简单描述
|
716
|
+
# @type Description: String
|
717
|
+
|
718
|
+
attr_accessor :Name, :Parameters, :Description
|
719
|
+
|
720
|
+
def initialize(name=nil, parameters=nil, description=nil)
|
721
|
+
@Name = name
|
722
|
+
@Parameters = parameters
|
723
|
+
@Description = description
|
724
|
+
end
|
725
|
+
|
726
|
+
def deserialize(params)
|
727
|
+
@Name = params['Name']
|
728
|
+
@Parameters = params['Parameters']
|
729
|
+
@Description = params['Description']
|
730
|
+
end
|
731
|
+
end
|
732
|
+
|
520
733
|
# Token 数量
|
521
734
|
class Usage < TencentCloud::Common::AbstractModel
|
522
735
|
# @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.
|
4
|
+
version: 3.0.858
|
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-07-
|
11
|
+
date: 2024-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|