tccli 3.0.1127.1__py2.py3-none-any.whl → 3.0.1128.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/asr/v20190614/api.json +7 -7
- tccli/services/asr/v20190614/examples.json +1 -1
- tccli/services/ccc/v20200210/api.json +1 -1
- tccli/services/cls/v20201016/api.json +9 -0
- tccli/services/domain/v20180808/api.json +16 -16
- tccli/services/domain/v20180808/examples.json +9 -9
- tccli/services/dsgc/v20190723/api.json +10 -1
- tccli/services/dts/v20180330/api.json +2 -2
- tccli/services/emr/emr_client.py +53 -0
- tccli/services/emr/v20190103/api.json +354 -0
- tccli/services/emr/v20190103/examples.json +8 -0
- tccli/services/ess/v20201111/api.json +4 -4
- tccli/services/ess/v20201111/examples.json +0 -6
- tccli/services/essbasic/v20210526/api.json +5 -5
- tccli/services/hunyuan/hunyuan_client.py +12 -118
- tccli/services/hunyuan/v20230901/api.json +0 -260
- tccli/services/hunyuan/v20230901/examples.json +0 -58
- tccli/services/iotexplorer/v20190423/api.json +9 -0
- tccli/services/monitor/v20180724/api.json +6 -5
- tccli/services/monitor/v20180724/examples.json +1 -1
- tccli/services/tse/v20201207/api.json +2 -2
- tccli/services/tse/v20201207/examples.json +2 -2
- tccli/services/waf/v20180125/api.json +94 -0
- tccli/services/waf/v20180125/examples.json +16 -0
- tccli/services/waf/waf_client.py +106 -0
- {tccli-3.0.1127.1.dist-info → tccli-3.0.1128.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1127.1.dist-info → tccli-3.0.1128.1.dist-info}/RECORD +31 -31
- {tccli-3.0.1127.1.dist-info → tccli-3.0.1128.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1127.1.dist-info → tccli-3.0.1128.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1127.1.dist-info → tccli-3.0.1128.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,59 +17,7 @@ from tencentcloud.hunyuan.v20230901 import models as models_v20230901
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
-
def
|
21
|
-
g_param = parse_global_arg(parsed_globals)
|
22
|
-
|
23
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
-
cred = credential.CVMRoleCredential()
|
25
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
-
cred = credential.STSAssumeRoleCredential(
|
27
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
-
)
|
30
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
31
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
-
else:
|
33
|
-
cred = credential.Credential(
|
34
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
-
)
|
36
|
-
http_profile = HttpProfile(
|
37
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
-
reqMethod="POST",
|
39
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
-
)
|
42
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
-
if g_param[OptionsDefine.Language]:
|
44
|
-
profile.language = g_param[OptionsDefine.Language]
|
45
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
-
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
-
model = models.SubmitHunyuanImageJobRequest()
|
50
|
-
model.from_json_string(json.dumps(args))
|
51
|
-
start_time = time.time()
|
52
|
-
while True:
|
53
|
-
rsp = client.SubmitHunyuanImageJob(model)
|
54
|
-
result = rsp.to_json_string()
|
55
|
-
try:
|
56
|
-
json_obj = json.loads(result)
|
57
|
-
except TypeError as e:
|
58
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
-
break
|
61
|
-
cur_time = time.time()
|
62
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
-
else:
|
67
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
-
|
71
|
-
|
72
|
-
def doChatPro(args, parsed_globals):
|
20
|
+
def doChatCompletions(args, parsed_globals):
|
73
21
|
g_param = parse_global_arg(parsed_globals)
|
74
22
|
|
75
23
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -98,11 +46,11 @@ def doChatPro(args, parsed_globals):
|
|
98
46
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
99
47
|
client._sdkVersion += ("_CLI_" + __version__)
|
100
48
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
-
model = models.
|
49
|
+
model = models.ChatCompletionsRequest()
|
102
50
|
model.from_json_string(json.dumps(args))
|
103
51
|
start_time = time.time()
|
104
52
|
while True:
|
105
|
-
rsp = client.
|
53
|
+
rsp = client.ChatCompletions(model)
|
106
54
|
result = rsp.to_json_string()
|
107
55
|
try:
|
108
56
|
json_obj = json.loads(result)
|
@@ -173,59 +121,7 @@ def doQueryHunyuanImageJob(args, parsed_globals):
|
|
173
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
122
|
|
175
123
|
|
176
|
-
def
|
177
|
-
g_param = parse_global_arg(parsed_globals)
|
178
|
-
|
179
|
-
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
180
|
-
cred = credential.CVMRoleCredential()
|
181
|
-
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
182
|
-
cred = credential.STSAssumeRoleCredential(
|
183
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
184
|
-
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
185
|
-
)
|
186
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
187
|
-
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
188
|
-
else:
|
189
|
-
cred = credential.Credential(
|
190
|
-
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
191
|
-
)
|
192
|
-
http_profile = HttpProfile(
|
193
|
-
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
194
|
-
reqMethod="POST",
|
195
|
-
endpoint=g_param[OptionsDefine.Endpoint],
|
196
|
-
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
197
|
-
)
|
198
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
199
|
-
if g_param[OptionsDefine.Language]:
|
200
|
-
profile.language = g_param[OptionsDefine.Language]
|
201
|
-
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
202
|
-
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
-
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
-
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
-
model = models.ChatStdRequest()
|
206
|
-
model.from_json_string(json.dumps(args))
|
207
|
-
start_time = time.time()
|
208
|
-
while True:
|
209
|
-
rsp = client.ChatStd(model)
|
210
|
-
result = rsp.to_json_string()
|
211
|
-
try:
|
212
|
-
json_obj = json.loads(result)
|
213
|
-
except TypeError as e:
|
214
|
-
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
215
|
-
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
216
|
-
break
|
217
|
-
cur_time = time.time()
|
218
|
-
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
219
|
-
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
220
|
-
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
221
|
-
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
222
|
-
else:
|
223
|
-
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
224
|
-
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
225
|
-
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
|
-
|
227
|
-
|
228
|
-
def doChatCompletions(args, parsed_globals):
|
124
|
+
def doGetEmbedding(args, parsed_globals):
|
229
125
|
g_param = parse_global_arg(parsed_globals)
|
230
126
|
|
231
127
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -254,11 +150,11 @@ def doChatCompletions(args, parsed_globals):
|
|
254
150
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
255
151
|
client._sdkVersion += ("_CLI_" + __version__)
|
256
152
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
257
|
-
model = models.
|
153
|
+
model = models.GetEmbeddingRequest()
|
258
154
|
model.from_json_string(json.dumps(args))
|
259
155
|
start_time = time.time()
|
260
156
|
while True:
|
261
|
-
rsp = client.
|
157
|
+
rsp = client.GetEmbedding(model)
|
262
158
|
result = rsp.to_json_string()
|
263
159
|
try:
|
264
160
|
json_obj = json.loads(result)
|
@@ -329,7 +225,7 @@ def doGetTokenCount(args, parsed_globals):
|
|
329
225
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
330
226
|
|
331
227
|
|
332
|
-
def
|
228
|
+
def doSubmitHunyuanImageJob(args, parsed_globals):
|
333
229
|
g_param = parse_global_arg(parsed_globals)
|
334
230
|
|
335
231
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -358,11 +254,11 @@ def doGetEmbedding(args, parsed_globals):
|
|
358
254
|
client = mod.HunyuanClient(cred, g_param[OptionsDefine.Region], profile)
|
359
255
|
client._sdkVersion += ("_CLI_" + __version__)
|
360
256
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
361
|
-
model = models.
|
257
|
+
model = models.SubmitHunyuanImageJobRequest()
|
362
258
|
model.from_json_string(json.dumps(args))
|
363
259
|
start_time = time.time()
|
364
260
|
while True:
|
365
|
-
rsp = client.
|
261
|
+
rsp = client.SubmitHunyuanImageJob(model)
|
366
262
|
result = rsp.to_json_string()
|
367
263
|
try:
|
368
264
|
json_obj = json.loads(result)
|
@@ -392,13 +288,11 @@ MODELS_MAP = {
|
|
392
288
|
}
|
393
289
|
|
394
290
|
ACTION_MAP = {
|
395
|
-
"SubmitHunyuanImageJob": doSubmitHunyuanImageJob,
|
396
|
-
"ChatPro": doChatPro,
|
397
|
-
"QueryHunyuanImageJob": doQueryHunyuanImageJob,
|
398
|
-
"ChatStd": doChatStd,
|
399
291
|
"ChatCompletions": doChatCompletions,
|
400
|
-
"
|
292
|
+
"QueryHunyuanImageJob": doQueryHunyuanImageJob,
|
401
293
|
"GetEmbedding": doGetEmbedding,
|
294
|
+
"GetTokenCount": doGetTokenCount,
|
295
|
+
"SubmitHunyuanImageJob": doSubmitHunyuanImageJob,
|
402
296
|
|
403
297
|
}
|
404
298
|
|
@@ -7,20 +7,6 @@
|
|
7
7
|
"output": "ChatCompletionsResponse",
|
8
8
|
"status": "online"
|
9
9
|
},
|
10
|
-
"ChatPro": {
|
11
|
-
"document": "<span style=\"font-size:1.5em;\">注意:本接口将于 5 月 15 日下线;下线后将不再提供文档指引,接口本身可继续调用,建议使用 [hunyuan](https://cloud.tencent.com/document/api/1729/105701) 接入。</span>\n\n腾讯混元大模型(hunyuan-pro)是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。\n\n 1. 本接口暂不支持返回图片内容。\n 2. 默认单账号限制并发数为 5 路,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。\n 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。",
|
12
|
-
"input": "ChatProRequest",
|
13
|
-
"name": "hunyuan-pro (即将下线)",
|
14
|
-
"output": "ChatProResponse",
|
15
|
-
"status": "online"
|
16
|
-
},
|
17
|
-
"ChatStd": {
|
18
|
-
"document": "<span style=\"font-size:1.5em;\">注意:本接口将于 5 月 15 日下线;下线后将不再提供文档指引,接口本身可继续调用,建议使用 [hunyuan](https://cloud.tencent.com/document/api/1729/105701) 接入。</span>\n\n腾讯混元大模型(hunyuan-standard)是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。\n\n 1. 本接口暂不支持返回图片内容。\n 2. 默认单账号限制并发数为 5 路,如您有提高并发限制的需求请 [联系我们](https://cloud.tencent.com/act/event/Online_service) 。\n 3. 请使用 SDK 调用本接口,每种开发语言的 SDK Git 仓库 examples/hunyuan/v20230901/ 目录下有提供示例供参考。SDK 链接在文档下方 “**开发者资源 - SDK**” 部分提供。",
|
19
|
-
"input": "ChatStdRequest",
|
20
|
-
"name": "hunyuan-standard (即将下线)",
|
21
|
-
"output": "ChatStdResponse",
|
22
|
-
"status": "online"
|
23
|
-
},
|
24
10
|
"GetEmbedding": {
|
25
11
|
"document": "腾讯混元 Embedding 接口,可以将文本转化为高质量的向量数据。",
|
26
12
|
"input": "GetEmbeddingRequest",
|
@@ -198,252 +184,6 @@
|
|
198
184
|
],
|
199
185
|
"type": "object"
|
200
186
|
},
|
201
|
-
"ChatProRequest": {
|
202
|
-
"document": "ChatPro请求参数结构体",
|
203
|
-
"members": [
|
204
|
-
{
|
205
|
-
"disabled": false,
|
206
|
-
"document": "聊天上下文信息。\n说明:\n1. 长度最多为 40,按对话时间从旧到新在数组中排列。\n2. Message.Role 可选值:system、user、assistant。\n其中,system 角色可选,如存在则必须位于列表的最开始。user 和 assistant 需交替出现(一问一答),以 user 提问开始和结束,且 Content 不能为空。Role 的顺序示例:[system(可选) user assistant user assistant user ...]。\n3. Messages 中 Content 总长度不能超过 hunyuan-pro 模型输入长度上限(可参考 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 文档),超过则会截断最前面的内容,只保留尾部内容。",
|
207
|
-
"example": "无",
|
208
|
-
"member": "Message",
|
209
|
-
"name": "Messages",
|
210
|
-
"required": true,
|
211
|
-
"type": "list"
|
212
|
-
},
|
213
|
-
{
|
214
|
-
"disabled": false,
|
215
|
-
"document": "说明:\n1. 影响输出文本的多样性,取值越大,生成文本的多样性越强。\n2. 默认 1.0,取值区间为 [0.0, 1.0]。\n3. 非必要不建议使用,不合理的取值会影响效果。",
|
216
|
-
"example": "1.0",
|
217
|
-
"member": "float",
|
218
|
-
"name": "TopP",
|
219
|
-
"required": false,
|
220
|
-
"type": "float"
|
221
|
-
},
|
222
|
-
{
|
223
|
-
"disabled": false,
|
224
|
-
"document": "说明:\n1. 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。\n2. 默认 1.0,取值区间为 [0.0, 2.0]。\n3. 非必要不建议使用,不合理的取值会影响效果。",
|
225
|
-
"example": "1.0",
|
226
|
-
"member": "float",
|
227
|
-
"name": "Temperature",
|
228
|
-
"required": false,
|
229
|
-
"type": "float"
|
230
|
-
},
|
231
|
-
{
|
232
|
-
"disabled": false,
|
233
|
-
"document": "流式调用开关。\n说明:\n1. 未传值时默认为流式调用。\n2. 流式调用时以 SSE 协议增量返回结果。\n3. 非流式调用时接口响应耗时较长,非必要不建议使用。\n4. 非流式调用时只返回一次最终结果,调用方式与普通 HTTP 请求无异。\n\n注意:\n通过 SDK 调用时,流式和非流式调用需要用**不同的方式**获取返回值,具体参考 SDK 中的注释或示例(在各语言 SDK 代码仓库的 examples/hunyuan/v20230901/ 目录中)。",
|
234
|
-
"example": "true",
|
235
|
-
"member": "bool",
|
236
|
-
"name": "Stream",
|
237
|
-
"required": false,
|
238
|
-
"type": "bool"
|
239
|
-
},
|
240
|
-
{
|
241
|
-
"disabled": false,
|
242
|
-
"document": "流式输出审核开关。\n说明:\n1. 输出审核有流式和同步两种模式,**流式模式首包响应更快**。\n2. 当使用流式输出(Stream 字段值为 true)时,该字段生效。\n3. 如果值为 true,将对输出内容进行分段审核,审核通过的内容流式输出返回。如果出现审核不过,响应中的 FinishReason 值为 sensitive。\n4. 如果未传值或值为 false,则不使用流式输出审核,需要审核完所有输出内容后再返回结果。\n\n注意:\n当选择流式输出审核时,可能会出现部分内容已输出,但中间某一段响应中的 FinishReason 值为 sensitive,此时说明安全审核未通过。如果业务场景有实时文字上屏的需求,需要自行撤回已上屏的内容,并建议自定义替换为一条提示语,如 “这个问题我不方便回答,不如我们换个话题试试”,以保障终端体验。",
|
243
|
-
"example": "false",
|
244
|
-
"member": "bool",
|
245
|
-
"name": "StreamModeration",
|
246
|
-
"required": false,
|
247
|
-
"type": "bool"
|
248
|
-
}
|
249
|
-
],
|
250
|
-
"type": "object"
|
251
|
-
},
|
252
|
-
"ChatProResponse": {
|
253
|
-
"document": "ChatPro返回参数结构体",
|
254
|
-
"members": [
|
255
|
-
{
|
256
|
-
"disabled": false,
|
257
|
-
"document": "Unix 时间戳,单位为秒。",
|
258
|
-
"example": "1705634032",
|
259
|
-
"member": "int64",
|
260
|
-
"name": "Created",
|
261
|
-
"output_required": false,
|
262
|
-
"type": "int",
|
263
|
-
"value_allowed_null": false
|
264
|
-
},
|
265
|
-
{
|
266
|
-
"disabled": false,
|
267
|
-
"document": "Token 统计信息。\n按照总 Token 数量计费。",
|
268
|
-
"example": "无",
|
269
|
-
"member": "Usage",
|
270
|
-
"name": "Usage",
|
271
|
-
"output_required": false,
|
272
|
-
"type": "object",
|
273
|
-
"value_allowed_null": false
|
274
|
-
},
|
275
|
-
{
|
276
|
-
"disabled": false,
|
277
|
-
"document": "免责声明。",
|
278
|
-
"example": "以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记",
|
279
|
-
"member": "string",
|
280
|
-
"name": "Note",
|
281
|
-
"output_required": false,
|
282
|
-
"type": "string",
|
283
|
-
"value_allowed_null": false
|
284
|
-
},
|
285
|
-
{
|
286
|
-
"disabled": false,
|
287
|
-
"document": "本轮对话的 ID。",
|
288
|
-
"example": "9c772634-8824-43e8-bc24-8bc4c19b9151",
|
289
|
-
"member": "string",
|
290
|
-
"name": "Id",
|
291
|
-
"output_required": false,
|
292
|
-
"type": "string",
|
293
|
-
"value_allowed_null": false
|
294
|
-
},
|
295
|
-
{
|
296
|
-
"disabled": false,
|
297
|
-
"document": "回复内容。",
|
298
|
-
"example": "无",
|
299
|
-
"member": "Choice",
|
300
|
-
"name": "Choices",
|
301
|
-
"output_required": false,
|
302
|
-
"type": "list",
|
303
|
-
"value_allowed_null": false
|
304
|
-
},
|
305
|
-
{
|
306
|
-
"disabled": false,
|
307
|
-
"document": "错误信息。\n如果流式返回中服务处理异常,返回该错误信息。\n注意:此字段可能返回 null,表示取不到有效值。",
|
308
|
-
"example": "无",
|
309
|
-
"member": "ErrorMsg",
|
310
|
-
"name": "ErrorMsg",
|
311
|
-
"output_required": false,
|
312
|
-
"type": "object",
|
313
|
-
"value_allowed_null": true
|
314
|
-
},
|
315
|
-
{
|
316
|
-
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header \"X-TC-RequestId\" 中。",
|
317
|
-
"member": "string",
|
318
|
-
"name": "RequestId",
|
319
|
-
"type": "string"
|
320
|
-
}
|
321
|
-
],
|
322
|
-
"type": "object"
|
323
|
-
},
|
324
|
-
"ChatStdRequest": {
|
325
|
-
"document": "ChatStd请求参数结构体",
|
326
|
-
"members": [
|
327
|
-
{
|
328
|
-
"disabled": false,
|
329
|
-
"document": "聊天上下文信息。\n说明:\n1. 长度最多为 40,按对话时间从旧到新在数组中排列。\n2. Message 的 Role 当前可选值:user、assistant。\n其中,user 和 assistant 需交替出现(一问一答),以 user 提问开始和结束,且 Content 不能为空。Role 的顺序示例:[user assistant user assistant user ...]。\n3. Messages 中 Content 总长度不能超过 hunyuan-standard 模型输入长度上限(可参考 [产品概述](https://cloud.tencent.com/document/product/1729/104753) 文档),超过则会截断最前面的内容,只保留尾部内容。",
|
330
|
-
"example": "无",
|
331
|
-
"member": "Message",
|
332
|
-
"name": "Messages",
|
333
|
-
"required": true,
|
334
|
-
"type": "list"
|
335
|
-
},
|
336
|
-
{
|
337
|
-
"disabled": false,
|
338
|
-
"document": "说明:\n1. 影响输出文本的多样性,取值越大,生成文本的多样性越强。\n2. 默认 1.0,取值区间为 [0.0, 1.0]。\n3. 非必要不建议使用,不合理的取值会影响效果。",
|
339
|
-
"example": "1.0",
|
340
|
-
"member": "float",
|
341
|
-
"name": "TopP",
|
342
|
-
"required": false,
|
343
|
-
"type": "float"
|
344
|
-
},
|
345
|
-
{
|
346
|
-
"disabled": false,
|
347
|
-
"document": "说明:\n1. 较高的数值会使输出更加随机,而较低的数值会使其更加集中和确定。\n2. 默认 1.0,取值区间为 [0.0, 2.0]。\n3. 非必要不建议使用,不合理的取值会影响效果。",
|
348
|
-
"example": "1.0",
|
349
|
-
"member": "float",
|
350
|
-
"name": "Temperature",
|
351
|
-
"required": false,
|
352
|
-
"type": "float"
|
353
|
-
},
|
354
|
-
{
|
355
|
-
"disabled": false,
|
356
|
-
"document": "流式调用开关。\n说明:\n1. 未传值时默认为流式调用。\n2. 流式调用时以 SSE 协议增量返回结果。\n3. 非流式调用时接口响应耗时较长,非必要不建议使用。\n4. 非流式调用时只返回一次最终结果,调用方式与普通 HTTP 请求无异。\n\n注意:\n通过 SDK 调用时,流式和非流式调用需要用**不同的方式**获取返回值,具体参考 SDK 中的注释或示例(在各语言 SDK 代码仓库的 examples/hunyuan/v20230901/ 目录中)。",
|
357
|
-
"example": "true",
|
358
|
-
"member": "bool",
|
359
|
-
"name": "Stream",
|
360
|
-
"required": false,
|
361
|
-
"type": "bool"
|
362
|
-
},
|
363
|
-
{
|
364
|
-
"disabled": false,
|
365
|
-
"document": "流式输出审核开关。\n说明:\n1. 输出审核有流式和同步两种模式,**流式模式首包响应更快**。\n2. 当使用流式输出(Stream 字段值为 true)时,该字段生效。\n3. 如果值为 true,将对输出内容进行分段审核,审核通过的内容流式输出返回。如果出现审核不过,响应中的 FinishReason 值为 sensitive。\n4. 如果未传值或值为 false,则不使用流式输出审核,需要审核完所有输出内容后再返回结果。\n\n注意:\n当选择流式输出审核时,可能会出现部分内容已输出,但中间某一段响应中的 FinishReason 值为 sensitive,此时说明安全审核未通过。如果业务场景有实时文字上屏的需求,需要自行撤回已上屏的内容,并建议自定义替换为一条提示语,如 “这个问题我不方便回答,不如我们换个话题试试”,以保障终端体验。",
|
366
|
-
"example": "false",
|
367
|
-
"member": "bool",
|
368
|
-
"name": "StreamModeration",
|
369
|
-
"required": false,
|
370
|
-
"type": "bool"
|
371
|
-
}
|
372
|
-
],
|
373
|
-
"type": "object"
|
374
|
-
},
|
375
|
-
"ChatStdResponse": {
|
376
|
-
"document": "ChatStd返回参数结构体",
|
377
|
-
"members": [
|
378
|
-
{
|
379
|
-
"disabled": false,
|
380
|
-
"document": "Unix 时间戳,单位为秒。",
|
381
|
-
"example": "1705634032",
|
382
|
-
"member": "int64",
|
383
|
-
"name": "Created",
|
384
|
-
"output_required": false,
|
385
|
-
"type": "int",
|
386
|
-
"value_allowed_null": false
|
387
|
-
},
|
388
|
-
{
|
389
|
-
"disabled": false,
|
390
|
-
"document": "Token 统计信息。\n按照总 Token 数量计费。",
|
391
|
-
"example": "无",
|
392
|
-
"member": "Usage",
|
393
|
-
"name": "Usage",
|
394
|
-
"output_required": false,
|
395
|
-
"type": "object",
|
396
|
-
"value_allowed_null": false
|
397
|
-
},
|
398
|
-
{
|
399
|
-
"disabled": false,
|
400
|
-
"document": "免责声明。",
|
401
|
-
"example": "以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记",
|
402
|
-
"member": "string",
|
403
|
-
"name": "Note",
|
404
|
-
"output_required": false,
|
405
|
-
"type": "string",
|
406
|
-
"value_allowed_null": false
|
407
|
-
},
|
408
|
-
{
|
409
|
-
"disabled": false,
|
410
|
-
"document": "本轮对话的 ID。",
|
411
|
-
"example": "9c772634-8824-43e8-bc24-8bc4c19b9151",
|
412
|
-
"member": "string",
|
413
|
-
"name": "Id",
|
414
|
-
"output_required": false,
|
415
|
-
"type": "string",
|
416
|
-
"value_allowed_null": false
|
417
|
-
},
|
418
|
-
{
|
419
|
-
"disabled": false,
|
420
|
-
"document": "回复内容。",
|
421
|
-
"example": "无",
|
422
|
-
"member": "Choice",
|
423
|
-
"name": "Choices",
|
424
|
-
"output_required": false,
|
425
|
-
"type": "list",
|
426
|
-
"value_allowed_null": false
|
427
|
-
},
|
428
|
-
{
|
429
|
-
"disabled": false,
|
430
|
-
"document": "错误信息。\n如果流式返回中服务处理异常,返回该错误信息。\n注意:此字段可能返回 null,表示取不到有效值。",
|
431
|
-
"example": "无",
|
432
|
-
"member": "ErrorMsg",
|
433
|
-
"name": "ErrorMsg",
|
434
|
-
"output_required": false,
|
435
|
-
"type": "object",
|
436
|
-
"value_allowed_null": true
|
437
|
-
},
|
438
|
-
{
|
439
|
-
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。本接口为流式响应接口,当请求成功时,RequestId 会被放在 HTTP 响应的 Header \"X-TC-RequestId\" 中。",
|
440
|
-
"member": "string",
|
441
|
-
"name": "RequestId",
|
442
|
-
"type": "string"
|
443
|
-
}
|
444
|
-
],
|
445
|
-
"type": "object"
|
446
|
-
},
|
447
187
|
"Choice": {
|
448
188
|
"document": "返回的回复, 支持多个",
|
449
189
|
"members": [
|
@@ -32,64 +32,6 @@
|
|
32
32
|
"title": "非流式请求成功示例"
|
33
33
|
}
|
34
34
|
],
|
35
|
-
"ChatPro": [
|
36
|
-
{
|
37
|
-
"document": "system提示词",
|
38
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatPro\n<公共请求参数>\n\n{\n \"TopP\": 1,\n \"Temperature\": 1,\n \"Messages\": [\n {\n \"Role\": \"system\",\n \"Content\": \"将英文单词转换为包括中文翻译、英文释义和一个例句的完整解释。请检查所有信息是否准确,并在回答时保持简洁,不需要任何其他反馈。\"\n },\n {\n \"Role\": \"user\",\n \"Content\": \"nice\"\n }\n ]\n}",
|
39
|
-
"output": "{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"很好\"}}],\"Created\":1705634813,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":1,\"TotalTokens\":37}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\":\"}}],\"Created\":1705634813,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":2,\"TotalTokens\":38}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"nice\"}}],\"Created\":1705634813,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":3,\"TotalTokens\":39}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\\n\"}}],\"Created\":1705634813,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":4,\"TotalTokens\":40}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"英文\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":5,\"TotalTokens\":41}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"释义\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":6,\"TotalTokens\":42}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\":\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":7,\"TotalTokens\":43}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"ple\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":8,\"TotalTokens\":44}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"asing\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":9,\"TotalTokens\":45}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\" or\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":10,\"TotalTokens\":46}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\" acceptable\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":11,\"TotalTokens\":47}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\\n\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":12,\"TotalTokens\":48}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"例\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":13,\"TotalTokens\":49}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"句\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":14,\"TotalTokens\":50}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\":\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":15,\"TotalTokens\":51}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"She\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":16,\"TotalTokens\":52}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\" had\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":17,\"TotalTokens\":53}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\" a\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":18,\"TotalTokens\":54}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\" nice\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":19,\"TotalTokens\":55}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\" smile\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":20,\"TotalTokens\":56}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\".\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":21,\"TotalTokens\":57}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"stop\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\"}}],\"Created\":1705634814,\"Id\":\"681ef57e-9f1e-4faa-a2d3-07b655a1fa1f\",\"Usage\":{\"PromptTokens\":36,\"CompletionTokens\":21,\"TotalTokens\":57}}",
|
40
|
-
"title": "system参数示例"
|
41
|
-
},
|
42
|
-
{
|
43
|
-
"document": "多轮对话场景",
|
44
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatPro\n<公共请求参数>\n\n{\n \"TopP\": 1,\n \"Temperature\": 1,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"请介绍下自己\"\n },\n {\n \"Role\": \"assistant\",\n \"Content\": \"我的名字是腾讯混元大模型,是腾讯开发的一款大型语言模型。我能够理解人类语言,擅长提供问答服务、常识推理、文本创作、数学计算和互动问答等服务。如果您需要帮助或有任何问题,请随时向我提问。\"\n },\n {\n \"Role\": \"user\",\n \"Content\": \"请给我讲个字数小于10个字的搞笑笑话\"\n },\n {\n \"Role\": \"assistant\",\n \"Content\": \"猫头鹰遇见眯眯眼,看得眼睛都眯成线。”\"\n },\n {\n \"Role\": \"user\",\n \"Content\": \"不好笑,换一个吧\"\n }\n ]\n}",
|
45
|
-
"output": "{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"青蛙\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":1,\"TotalTokens\":86}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"跳\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":2,\"TotalTokens\":87}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"高\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":3,\"TotalTokens\":88}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\",\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":4,\"TotalTokens\":89}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"比\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":5,\"TotalTokens\":90}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"下马\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":6,\"TotalTokens\":91}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"。\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":7,\"TotalTokens\":92}}\n{\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"stop\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\"}}],\"Created\":1705634032,\"Id\":\"9c772634-8824-43e8-bc24-8bc4c19b9151\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":7,\"TotalTokens\":92}}",
|
46
|
-
"title": "多轮对话示例"
|
47
|
-
},
|
48
|
-
{
|
49
|
-
"document": "",
|
50
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatPro\n<公共请求参数>\n\n{\n \"TopP\": 0,\n \"Temperature\": 4.8,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"介绍下自己\"\n }\n ]\n}",
|
51
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"188cc996-ab09-49a7-aa9f-1df88f11c6b4\",\n \"Error\": {\n \"Code\": \"InvalidParameter\",\n \"Message\": \"Temperature must be 2 or less\"\n }\n }\n}",
|
52
|
-
"title": "请求失败示例"
|
53
|
-
},
|
54
|
-
{
|
55
|
-
"document": "",
|
56
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatPro\n<公共请求参数>\n\n{\n \"TopP\": 1,\n \"Temperature\": 1,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"计算1+1\"\n }\n ]\n}",
|
57
|
-
"output": "HTTP/1.1 200 OK\nCache-Control: no-cache\nConnection: keep-alive\nContent-Type: text/event-stream\nDate: Tue, 21 Nov 2023 06:56:00 GMT\nTransfer-Encoding: chunked\nX-TC-RequestId: 61a8459b-27c8-4868-af8f-f374db0245f8\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"1\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":2,\"TotalTokens\":6}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"+\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":3,\"TotalTokens\":7}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"1\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":4,\"TotalTokens\":8}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"=\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":5,\"TotalTokens\":9}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"2\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":5,\"TotalTokens\":9}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"stop\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":5,\"TotalTokens\":9}}",
|
58
|
-
"title": "流式请求成功示例"
|
59
|
-
},
|
60
|
-
{
|
61
|
-
"document": "",
|
62
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatPro\n<公共请求参数>\n\n{\n \"TopP\": 0,\n \"Stream\": false,\n \"Temperature\": 0,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"你好呀!\"\n }\n ]\n}",
|
63
|
-
"output": "{\n \"Note\": \"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\n \"Choices\": [\n {\n \"FinishReason\": \"stop\",\n \"Message\": {\n \"Role\": \"assistant\",\n \"Content\": \"你好!很高兴为您提供帮助。请问有什么问题我可以帮助您解决?\"\n }\n }\n ],\n \"Created\": 1710902312,\n \"Id\": \"e4657570-94a5-45f1-896c-a00ac3471d51\",\n \"Usage\": {\n \"PromptTokens\": 3,\n \"CompletionTokens\": 14,\n \"TotalTokens\": 17\n }\n}",
|
64
|
-
"title": "非流式请求成功示例"
|
65
|
-
}
|
66
|
-
],
|
67
|
-
"ChatStd": [
|
68
|
-
{
|
69
|
-
"document": "多轮对话场景",
|
70
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatPro\n<公共请求参数>\n\n{\n \"TopP\": 1,\n \"Temperature\": 1,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"请介绍下自己\"\n },\n {\n \"Role\": \"assistant\",\n \"Content\": \"我的名字是腾讯混元大模型,是腾讯开发的一款大型语言模型。我能够理解人类语言,擅长提供问答服务、常识推理、文本创作、数学计算和互动问答等服务。如果您需要帮助或有任何问题,请随时向我提问。\"\n },\n {\n \"Role\": \"user\",\n \"Content\": \"请给我讲个字数小于10个字的搞笑笑话\"\n },\n {\n \"Role\": \"assistant\",\n \"Content\": \"猫头鹰遇见眯眯眼,看得眼睛都眯成线。”\"\n },\n {\n \"Role\": \"user\",\n \"Content\": \"不好笑,换一个吧\"\n }\n ]\n}",
|
71
|
-
"output": " {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"老鼠\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":1,\"TotalTokens\":86}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"遇见\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":2,\"TotalTokens\":87}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"猫\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":3,\"TotalTokens\":88}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\",\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":4,\"TotalTokens\":89}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"逃\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":5,\"TotalTokens\":90}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"得\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":6,\"TotalTokens\":91}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"比\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":7,\"TotalTokens\":92}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"闪电\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":8,\"TotalTokens\":93}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"快\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":9,\"TotalTokens\":94}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"。\"}}],\"Created\":1705635290,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":10,\"TotalTokens\":95}}\n {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"stop\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\"}}],\"Created\":1705635291,\"Id\":\"eb53a6d6-c000-4b74-aad2-a8e82540518a\",\"Usage\":{\"PromptTokens\":85,\"CompletionTokens\":10,\"TotalTokens\":95}}",
|
72
|
-
"title": "多轮对话示例"
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"document": "",
|
76
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatStd\n<公共请求参数>\n\n{\n \"TopP\": 0,\n \"Temperature\": 4.8,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"介绍下自己\"\n }\n ]\n}",
|
77
|
-
"output": "{\n \"Response\": {\n \"RequestId\": \"655c67aad32b0f48f52b89b0\",\n \"Error\": {\n \"Code\": \"InvalidParameter\",\n \"Message\": \"The value of Temperature should be within the range [0.0, 2.0]: 4.800000 \"\n }\n }\n}",
|
78
|
-
"title": "请求失败示例"
|
79
|
-
},
|
80
|
-
{
|
81
|
-
"document": "",
|
82
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatStd\n<公共请求参数>\n\n{\n \"TopP\": 0,\n \"Stream\": true,\n \"Temperature\": 0,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"计算1+1\"\n }\n ]\n}",
|
83
|
-
"output": "HTTP/1.1 200 OK\nCache-Control: no-cache\nConnection: keep-alive\nContent-Type: text/event-stream\nDate: Tue, 21 Nov 2023 06:56:00 GMT\nTransfer-Encoding: chunked\nX-TC-RequestId: 61a8459b-27c8-4868-af8f-f374db0245f8\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"1\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":2,\"TotalTokens\":6}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"+\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":3,\"TotalTokens\":7}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"1\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":4,\"TotalTokens\":8}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"=\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":5,\"TotalTokens\":9}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"2\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":5,\"TotalTokens\":9}}\n\ndata: {\"Note\":\"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\"Choices\":[{\"FinishReason\":\"stop\",\"Delta\":{\"Role\":\"assistant\",\"Content\":\"\"}}],\"Created\":1700549760,\"Id\":\"148b89ef-14e1-489f-8e70-b767e5b27d56\",\"Usage\":{\"PromptTokens\":4,\"CompletionTokens\":5,\"TotalTokens\":9}}",
|
84
|
-
"title": "流式请求成功示例"
|
85
|
-
},
|
86
|
-
{
|
87
|
-
"document": "",
|
88
|
-
"input": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ChatStd\n<公共请求参数>\n\n{\n \"TopP\": 0,\n \"Stream\": false,\n \"Temperature\": 0,\n \"Messages\": [\n {\n \"Role\": \"user\",\n \"Content\": \"你好呀!\"\n }\n ]\n}",
|
89
|
-
"output": "{\n \"Note\": \"以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记\",\n \"Choices\": [\n {\n \"FinishReason\": \"stop\",\n \"Message\": {\n \"Role\": \"assistant\",\n \"Content\": \"你好!很高兴为您提供帮助。请问有什么问题我可以帮助您解决?\"\n }\n }\n ],\n \"Created\": 1710902312,\n \"Id\": \"e4657570-94a5-45f1-896c-a00ac3471d51\",\n \"Usage\": {\n \"PromptTokens\": 3,\n \"CompletionTokens\": 14,\n \"TotalTokens\": 17\n }\n}",
|
90
|
-
"title": "非流式请求成功示例"
|
91
|
-
}
|
92
|
-
],
|
93
35
|
"GetEmbedding": [
|
94
36
|
{
|
95
37
|
"document": "POST / HTTP/1.1\nHost: hunyuan.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: GetEmbedding\n<公共请求参数>",
|
@@ -9043,6 +9043,15 @@
|
|
9043
9043
|
"name": "ModelId",
|
9044
9044
|
"required": false,
|
9045
9045
|
"type": "string"
|
9046
|
+
},
|
9047
|
+
{
|
9048
|
+
"disabled": false,
|
9049
|
+
"document": "小程序APPID",
|
9050
|
+
"example": "无",
|
9051
|
+
"member": "string",
|
9052
|
+
"name": "MiniProgramAppId",
|
9053
|
+
"required": false,
|
9054
|
+
"type": "string"
|
9046
9055
|
}
|
9047
9056
|
],
|
9048
9057
|
"type": "object"
|