tencentcloud-sdk-hunyuan 3.0.1019 → 3.0.1020
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/client.rb +31 -0
- data/lib/v20230901/models.rb +222 -6
- 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: df1b13b28bea114f383f27a2c72e8cc41af024c0
|
4
|
+
data.tar.gz: 83148fa570ae9c2ee24defc1ca1b5c95239b45d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ef916fa72d7da0db680b1233769d2ac51241b321240f42908c7d59548a880a9eda24f43bccabf9a878ba58827469c13ac2596d04ac25bae5acde6193160ce97
|
7
|
+
data.tar.gz: 1e5fa5a1f8dee877d56ae6add609fb5f3dcce0d563da448da9db5fc4d7b052f361eaea7cd13229e6040868ca44d0432922e1da66ec60e999c8d8bc8456402d64
|
data/lib/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.1020
|
data/lib/v20230901/client.rb
CHANGED
@@ -350,6 +350,37 @@ module TencentCloud
|
|
350
350
|
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
351
351
|
end
|
352
352
|
|
353
|
+
# 如需使用OpenAI兼容接口, 请参考文档:[OpenAI 兼容接口](https://cloud.tencent.com/document/product/1729/111007)
|
354
|
+
|
355
|
+
# 腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。
|
356
|
+
|
357
|
+
# 1. 本接口暂不支持返回图片内容。
|
358
|
+
# 2. 默认该接口下单账号限制并发数为 5 路,如您有提高并发限制的需求请 [购买](https://buy.cloud.tencent.com/hunyuan) 。
|
359
|
+
# 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。
|
360
|
+
# 4. 我们推荐您使用 API Explorer,方便快速地在线调试接口和下载各语言的示例代码,[点击打开](https://console.cloud.tencent.com/api/explorer?Product=hunyuan&Version=2023-09-01&Action=ChatCompletions)。
|
361
|
+
|
362
|
+
# @param request: Request instance for GroupChatCompletions.
|
363
|
+
# @type request: :class:`Tencentcloud::hunyuan::V20230901::GroupChatCompletionsRequest`
|
364
|
+
# @rtype: :class:`Tencentcloud::hunyuan::V20230901::GroupChatCompletionsResponse`
|
365
|
+
def GroupChatCompletions(request)
|
366
|
+
body = send_request('GroupChatCompletions', request.serialize)
|
367
|
+
response = JSON.parse(body)
|
368
|
+
if response['Response'].key?('Error') == false
|
369
|
+
model = GroupChatCompletionsResponse.new
|
370
|
+
model.deserialize(response['Response'])
|
371
|
+
model
|
372
|
+
else
|
373
|
+
code = response['Response']['Error']['Code']
|
374
|
+
message = response['Response']['Error']['Message']
|
375
|
+
reqid = response['Response']['RequestId']
|
376
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(code, message, reqid)
|
377
|
+
end
|
378
|
+
rescue TencentCloud::Common::TencentCloudSDKException => e
|
379
|
+
raise e
|
380
|
+
rescue StandardError => e
|
381
|
+
raise TencentCloud::Common::TencentCloudSDKException.new(nil, e.inspect)
|
382
|
+
end
|
383
|
+
|
353
384
|
# 混元生图(多轮对话)接口基于混元大模型,将根据输入的文本描述生成图像,支持通过多轮对话的方式不断调整图像内容。分为提交任务和查询任务2个接口。
|
354
385
|
# 提交任务:输入文本和前置对话 ID 等,提交一个混元生图多轮对话异步任务,获得任务 ID。
|
355
386
|
# 查询任务:根据任务 ID 查询任务的处理状态、处理结果,任务处理完成后可获得在上一轮对话基础上继续生成的图像结果。
|
data/lib/v20230901/models.rb
CHANGED
@@ -49,6 +49,26 @@ module TencentCloud
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
# 人物描述
|
53
|
+
class Character < TencentCloud::Common::AbstractModel
|
54
|
+
# @param Name: 人物名称
|
55
|
+
# @type Name: String
|
56
|
+
# @param SystemPrompt: 人物对应SystemPrompt
|
57
|
+
# @type SystemPrompt: String
|
58
|
+
|
59
|
+
attr_accessor :Name, :SystemPrompt
|
60
|
+
|
61
|
+
def initialize(name=nil, systemprompt=nil)
|
62
|
+
@Name = name
|
63
|
+
@SystemPrompt = systemprompt
|
64
|
+
end
|
65
|
+
|
66
|
+
def deserialize(params)
|
67
|
+
@Name = params['Name']
|
68
|
+
@SystemPrompt = params['SystemPrompt']
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
52
72
|
# ChatCompletions请求参数结构体
|
53
73
|
class ChatCompletionsRequest < TencentCloud::Common::AbstractModel
|
54
74
|
# @param Model: 模型名称,可选值包括 hunyuan-lite、hunyuan-standard、hunyuan-standard-256K、hunyuan-code、hunyuan-role、hunyuan-functioncall、hunyuan-vision、hunyuan-turbo、hunyuan-turbo-latest、hunyuan-turbo-20241223、hunyuan-turbo-20241120、hunyuan-large、hunyuan-large-longcontext、hunyuan-turbo-vision、hunyuan-standard-vision、hunyuan-lite-vision、hunyuan-turbos-20250226、hunyuan-turbos-latest。各模型介绍请阅读 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 中的说明。注意:不同的模型计费不同,请根据 [购买指南](https://cloud.tencent.com/document/product/1729/97731) 按需调用。
|
@@ -247,8 +267,8 @@ module TencentCloud
|
|
247
267
|
|
248
268
|
attr_accessor :Created, :Usage, :Note, :Id, :Choices, :ErrorMsg, :ModerationLevel, :SearchInfo, :Replaces, :RecommendedQuestions, :RequestId
|
249
269
|
extend Gem::Deprecate
|
250
|
-
deprecate :ModerationLevel, :none, 2025,
|
251
|
-
deprecate :ModerationLevel=, :none, 2025,
|
270
|
+
deprecate :ModerationLevel, :none, 2025, 3
|
271
|
+
deprecate :ModerationLevel=, :none, 2025, 3
|
252
272
|
|
253
273
|
def initialize(created=nil, usage=nil, note=nil, id=nil, choices=nil, errormsg=nil, moderationlevel=nil, searchinfo=nil, replaces=nil, recommendedquestions=nil, requestid=nil)
|
254
274
|
@Created = created
|
@@ -944,10 +964,10 @@ module TencentCloud
|
|
944
964
|
|
945
965
|
attr_accessor :Data, :FirstID, :LastID, :HasMore, :Object, :FirstMsgID, :LastMsgID, :RequestId
|
946
966
|
extend Gem::Deprecate
|
947
|
-
deprecate :FirstID, :none, 2025,
|
948
|
-
deprecate :FirstID=, :none, 2025,
|
949
|
-
deprecate :LastID, :none, 2025,
|
950
|
-
deprecate :LastID=, :none, 2025,
|
967
|
+
deprecate :FirstID, :none, 2025, 3
|
968
|
+
deprecate :FirstID=, :none, 2025, 3
|
969
|
+
deprecate :LastID, :none, 2025, 3
|
970
|
+
deprecate :LastID=, :none, 2025, 3
|
951
971
|
|
952
972
|
def initialize(data=nil, firstid=nil, lastid=nil, hasmore=nil, object=nil, firstmsgid=nil, lastmsgid=nil, requestid=nil)
|
953
973
|
@Data = data
|
@@ -1179,6 +1199,202 @@ module TencentCloud
|
|
1179
1199
|
end
|
1180
1200
|
end
|
1181
1201
|
|
1202
|
+
# GroupChatCompletions请求参数结构体
|
1203
|
+
class GroupChatCompletionsRequest < TencentCloud::Common::AbstractModel
|
1204
|
+
# @param Model: 模型名称,可选值包括 hunyuan-large-role-group。各模型介绍请阅读 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 中的说明。注意:不同的模型计费不同,请根据 [购买指南](https://cloud.tencent.com/document/product/1729/97731) 按需调用。
|
1205
|
+
# @type Model: String
|
1206
|
+
# @param Messages: 聊天上下文信息。
|
1207
|
+
# @type Messages: Array
|
1208
|
+
# @param Stream: 流式调用开关。
|
1209
|
+
# 说明:
|
1210
|
+
# 1. 未传值时默认为非流式调用(false)。
|
1211
|
+
# 2. 流式调用时以 SSE 协议增量返回结果(返回值取 Choices[n].Delta 中的值,需要拼接增量数据才能获得完整结果)。
|
1212
|
+
# 3. 非流式调用时:
|
1213
|
+
# 调用方式与普通 HTTP 请求无异。
|
1214
|
+
# 接口响应耗时较长,**如需更低时延建议设置为 true**。
|
1215
|
+
# 只返回一次最终结果(返回值取 Choices[n].Message 中的值)。
|
1216
|
+
|
1217
|
+
# 注意:
|
1218
|
+
# 通过 SDK 调用时,流式和非流式调用需用**不同的方式**获取返回值,具体参考 SDK 中的注释或示例(在各语言 SDK 代码仓库的 examples/hunyuan/v20230901/ 目录中)。
|
1219
|
+
# @type Stream: Boolean
|
1220
|
+
# @param TargetCharacterName: 目标人物名称
|
1221
|
+
# @type TargetCharacterName: String
|
1222
|
+
# @param GroupChatConfig: 角色描述
|
1223
|
+
# @type GroupChatConfig: :class:`Tencentcloud::Hunyuan.v20230901.models.GroupChatConfig`
|
1224
|
+
# @param UserId: 用户ID
|
1225
|
+
# @type UserId: String
|
1226
|
+
# @param SessionId: 对话接口
|
1227
|
+
# @type SessionId: String
|
1228
|
+
|
1229
|
+
attr_accessor :Model, :Messages, :Stream, :TargetCharacterName, :GroupChatConfig, :UserId, :SessionId
|
1230
|
+
|
1231
|
+
def initialize(model=nil, messages=nil, stream=nil, targetcharactername=nil, groupchatconfig=nil, userid=nil, sessionid=nil)
|
1232
|
+
@Model = model
|
1233
|
+
@Messages = messages
|
1234
|
+
@Stream = stream
|
1235
|
+
@TargetCharacterName = targetcharactername
|
1236
|
+
@GroupChatConfig = groupchatconfig
|
1237
|
+
@UserId = userid
|
1238
|
+
@SessionId = sessionid
|
1239
|
+
end
|
1240
|
+
|
1241
|
+
def deserialize(params)
|
1242
|
+
@Model = params['Model']
|
1243
|
+
unless params['Messages'].nil?
|
1244
|
+
@Messages = []
|
1245
|
+
params['Messages'].each do |i|
|
1246
|
+
groupmessage_tmp = GroupMessage.new
|
1247
|
+
groupmessage_tmp.deserialize(i)
|
1248
|
+
@Messages << groupmessage_tmp
|
1249
|
+
end
|
1250
|
+
end
|
1251
|
+
@Stream = params['Stream']
|
1252
|
+
@TargetCharacterName = params['TargetCharacterName']
|
1253
|
+
unless params['GroupChatConfig'].nil?
|
1254
|
+
@GroupChatConfig = GroupChatConfig.new
|
1255
|
+
@GroupChatConfig.deserialize(params['GroupChatConfig'])
|
1256
|
+
end
|
1257
|
+
@UserId = params['UserId']
|
1258
|
+
@SessionId = params['SessionId']
|
1259
|
+
end
|
1260
|
+
end
|
1261
|
+
|
1262
|
+
# GroupChatCompletions返回参数结构体
|
1263
|
+
class GroupChatCompletionsResponse < TencentCloud::Common::AbstractModel
|
1264
|
+
# @param Created: Unix 时间戳,单位为秒。
|
1265
|
+
# @type Created: Integer
|
1266
|
+
# @param Usage: Token 统计信息。
|
1267
|
+
# 按照总 Token 数量计费。
|
1268
|
+
# @type Usage: :class:`Tencentcloud::Hunyuan.v20230901.models.Usage`
|
1269
|
+
# @param Note: 免责声明。
|
1270
|
+
# @type Note: String
|
1271
|
+
# @param Id: 本次请求的 RequestId。
|
1272
|
+
# @type Id: String
|
1273
|
+
# @param Choices: 回复内容。
|
1274
|
+
# @type Choices: Array
|
1275
|
+
# @param ErrorMsg: 错误信息。
|
1276
|
+
# 如果流式返回中服务处理异常,返回该错误信息。
|
1277
|
+
# 注意:此字段可能返回 null,表示取不到有效值。
|
1278
|
+
# @type ErrorMsg: :class:`Tencentcloud::Hunyuan.v20230901.models.ErrorMsg`
|
1279
|
+
# @param SearchInfo: 搜索结果信息
|
1280
|
+
# @type SearchInfo: :class:`Tencentcloud::Hunyuan.v20230901.models.SearchInfo`
|
1281
|
+
# @param Replaces: 多媒体信息。
|
1282
|
+
# 说明:
|
1283
|
+
# 1. 可以用多媒体信息替换回复内容里的占位符,得到完整的消息。
|
1284
|
+
# 2. 可能会出现回复内容里存在占位符,但是因为审核等原因没有返回多媒体信息。
|
1285
|
+
# @type Replaces: Array
|
1286
|
+
# @param RecommendedQuestions: 推荐问答。
|
1287
|
+
# @type RecommendedQuestions: Array
|
1288
|
+
# @param RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header "X-TC-RequestId" 中。
|
1289
|
+
# @type RequestId: String
|
1290
|
+
|
1291
|
+
attr_accessor :Created, :Usage, :Note, :Id, :Choices, :ErrorMsg, :SearchInfo, :Replaces, :RecommendedQuestions, :RequestId
|
1292
|
+
|
1293
|
+
def initialize(created=nil, usage=nil, note=nil, id=nil, choices=nil, errormsg=nil, searchinfo=nil, replaces=nil, recommendedquestions=nil, requestid=nil)
|
1294
|
+
@Created = created
|
1295
|
+
@Usage = usage
|
1296
|
+
@Note = note
|
1297
|
+
@Id = id
|
1298
|
+
@Choices = choices
|
1299
|
+
@ErrorMsg = errormsg
|
1300
|
+
@SearchInfo = searchinfo
|
1301
|
+
@Replaces = replaces
|
1302
|
+
@RecommendedQuestions = recommendedquestions
|
1303
|
+
@RequestId = requestid
|
1304
|
+
end
|
1305
|
+
|
1306
|
+
def deserialize(params)
|
1307
|
+
@Created = params['Created']
|
1308
|
+
unless params['Usage'].nil?
|
1309
|
+
@Usage = Usage.new
|
1310
|
+
@Usage.deserialize(params['Usage'])
|
1311
|
+
end
|
1312
|
+
@Note = params['Note']
|
1313
|
+
@Id = params['Id']
|
1314
|
+
unless params['Choices'].nil?
|
1315
|
+
@Choices = []
|
1316
|
+
params['Choices'].each do |i|
|
1317
|
+
choice_tmp = Choice.new
|
1318
|
+
choice_tmp.deserialize(i)
|
1319
|
+
@Choices << choice_tmp
|
1320
|
+
end
|
1321
|
+
end
|
1322
|
+
unless params['ErrorMsg'].nil?
|
1323
|
+
@ErrorMsg = ErrorMsg.new
|
1324
|
+
@ErrorMsg.deserialize(params['ErrorMsg'])
|
1325
|
+
end
|
1326
|
+
unless params['SearchInfo'].nil?
|
1327
|
+
@SearchInfo = SearchInfo.new
|
1328
|
+
@SearchInfo.deserialize(params['SearchInfo'])
|
1329
|
+
end
|
1330
|
+
unless params['Replaces'].nil?
|
1331
|
+
@Replaces = []
|
1332
|
+
params['Replaces'].each do |i|
|
1333
|
+
replace_tmp = Replace.new
|
1334
|
+
replace_tmp.deserialize(i)
|
1335
|
+
@Replaces << replace_tmp
|
1336
|
+
end
|
1337
|
+
end
|
1338
|
+
@RecommendedQuestions = params['RecommendedQuestions']
|
1339
|
+
@RequestId = params['RequestId']
|
1340
|
+
end
|
1341
|
+
end
|
1342
|
+
|
1343
|
+
# 群聊配置
|
1344
|
+
class GroupChatConfig < TencentCloud::Common::AbstractModel
|
1345
|
+
# @param UserName: 人物名称
|
1346
|
+
# @type UserName: String
|
1347
|
+
# @param Description: ### 主题:\n武道修炼与科技创新的碰撞\n\n### 地点:\n布尔玛的实验室\n\n### 故事背景:\n布尔玛正在研发一种新型的龙珠雷达,旨在更精确地定位龙珠的位置。她邀请了孙悟空、天津饭、饺子和雅木茶前来测试新设备。然而,这些武道家们对科技的理解有限,导致了一系列有趣的误解和互动。\n\n### 人物关系:\n- **布尔玛**:天才科学家,负责研发和解释新设备。\n- **孙悟空**:纯粹的战斗狂,对科技一窍不通,但对新事物充满好奇。\n- **天津饭**:严肃自律的武道家,对科技持谨慎态度,但愿意尝试。\n- **饺子**:内向单纯,依赖天津饭,对科技感到困惑和害怕。\n- **雅木茶**:幽默自嘲的前沙漠强盗,对科技有一定了解,但更倾向于轻松调侃。\n\n### 人物目标:\n- **布尔玛**:希望新龙珠雷达能够得到有效测试,并得到反馈以改进。\n- **孙悟空**:希望通过新设备找到更强的对手进行战斗。\n- **天津饭**:希望通过测试新设备提升自己的武道修炼。\n- **饺子**:希望在不引起麻烦的情况下完成任务,并得到天津饭的认可。\n- **雅木茶**:希望通过参与测试证明自己的价值,同时享受与朋友们的互动。\n\n### 场景描述:\n布尔玛在实验室中展示她的新龙珠雷达,解释其工作原理和优势。孙悟空对设备的功能感到兴奋,但完全无法理解技术细节,不断提出天真的问题。天津饭则严肃地询问设备的安全性和可靠性,表现出对科技的谨慎态度。饺子对复杂的设备感到害怕,不断向天津饭寻求确认和安慰。雅木茶则在一旁调侃大家的反应,试图缓解紧张气氛。布尔玛在解释过程中不断被孙悟空的问题打断,感到无奈,但也被他的热情所感染。最终,大家决定一起外出测试新设备,展开一场充满欢笑和冒险的旅程。
|
1348
|
+
# @type Description: String
|
1349
|
+
# @param Characters: 角色描述
|
1350
|
+
# @type Characters: Array
|
1351
|
+
|
1352
|
+
attr_accessor :UserName, :Description, :Characters
|
1353
|
+
|
1354
|
+
def initialize(username=nil, description=nil, characters=nil)
|
1355
|
+
@UserName = username
|
1356
|
+
@Description = description
|
1357
|
+
@Characters = characters
|
1358
|
+
end
|
1359
|
+
|
1360
|
+
def deserialize(params)
|
1361
|
+
@UserName = params['UserName']
|
1362
|
+
@Description = params['Description']
|
1363
|
+
unless params['Characters'].nil?
|
1364
|
+
@Characters = []
|
1365
|
+
params['Characters'].each do |i|
|
1366
|
+
character_tmp = Character.new
|
1367
|
+
character_tmp.deserialize(i)
|
1368
|
+
@Characters << character_tmp
|
1369
|
+
end
|
1370
|
+
end
|
1371
|
+
end
|
1372
|
+
end
|
1373
|
+
|
1374
|
+
# 群聊会话内容
|
1375
|
+
class GroupMessage < TencentCloud::Common::AbstractModel
|
1376
|
+
# @param Role: 角色,可选值包括 system、user、assistant、 tool。
|
1377
|
+
# @type Role: String
|
1378
|
+
# @param Content: 文本内容
|
1379
|
+
# @type Content: String
|
1380
|
+
# @param Name: 角色名称
|
1381
|
+
# @type Name: String
|
1382
|
+
|
1383
|
+
attr_accessor :Role, :Content, :Name
|
1384
|
+
|
1385
|
+
def initialize(role=nil, content=nil, name=nil)
|
1386
|
+
@Role = role
|
1387
|
+
@Content = content
|
1388
|
+
@Name = name
|
1389
|
+
end
|
1390
|
+
|
1391
|
+
def deserialize(params)
|
1392
|
+
@Role = params['Role']
|
1393
|
+
@Content = params['Content']
|
1394
|
+
@Name = params['Name']
|
1395
|
+
end
|
1396
|
+
end
|
1397
|
+
|
1182
1398
|
# 混元生图多轮对话历史记录。
|
1183
1399
|
class History < TencentCloud::Common::AbstractModel
|
1184
1400
|
# @param ChatId: 对话的 ID,用于唯一标识一轮对话
|
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.1020
|
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-03-
|
11
|
+
date: 2025-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tencentcloud-sdk-common
|