API 接口文档

API服务地址

参数名
说明
URL
请求方式
POST
调用API,需要先完成智能体的创建,获取智能体的 appkey 和 appid填入相应参数,获取方法参考下文。
参数解释:
appkey:本接口为HTTP接口,通过Bearer方式鉴权。appkey就是Bearer的token。
appid: 请求体中 assistant_id 填写appid即可。
注意事项:
目前元器的智能体API并发限制为10,为了避免服务宕机,请勿短时间内大量调用API。

CURL调用示例(先将appkey和appid替换为要调用智能体的值):
curl --location 'https://yuanqi.tencent.com/openapi/v1/agent/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer appkey' \
--data '{
"assistant_id": "appid",
"user_id": "username",
"stream": true,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "你好"
}
]
}
]
}'

获取调用智能体appid

您可以在下图位置找到您的智能体的appid的取值:
智能体配置——应用发布——服务状态——体验链接——appid



获取调用智能体appkey

您可以在您的智能体调试页面——应用发布——API管理中,看到您的appkey。



请求参数

参数名
类型
是否必选
说明
assistant_id
string
助手ID
version
number
助手版本 (仅对内部开放)
user_id
string
用户ID,调用者业务侧的用户ID,会影响智能体的数据统计,建议按实际情况填写
stream
bool
是否以流式接口的形式返回数据,默认false
chat_type
string
默认为published,传preview时,表示使用草稿态智能体 (仅对内部开放)
messages
list
会话内容, 长度最多为40, 按对话时间从旧到新在数组中排列
messages[n].role
string
角色, 'user'或者'assistant', 在message中必须是user与assistant交替(一问一答)
messages[n].content
list
可以传入多种类型的内容,如图片、文件或文本
messages[n].content[m].type
string
内容的类型,可选参数为'text'或'image_url'
messages[n].content[m].text
string
当type为text时使用,表示具体的文本内容
messages[n].content[m].image_url
object
当type为image_url时使用,表示具体的图片内容
messages[n].content[m].image_url.type
string
目前仅支持图片,要传入image_url
messages[n].content[m].image_url.url
string
图片的url地址
custom_variables
map[string]string
工作流场景
自定义参数可用于传递参数给工作流开始节点的API参数字段,通过该API参数字段可以被工作流识别并使用,具体参考开始节点使用文档。
自定义API参数的值。可以配置多个 key: value 对,key 为自定义参数的参数名称,value 为对应的自定义参数的运行时的值。
⚠️注意:
map的key和value类型都是string,如{"UserID":"10220022"}, 不合法的参数如: {"UserID": 10220022}; 其中value也可以是json字符串,如 {"Data": "{\"UserID\":\"10220022\",\"Score\":{\"Chinese\":89,\"Math\":98}}"}

检索知识库范围设置场景
自定义参数可用于设置知识库检索范围,如需传入多个参数值,使用英文竖线分隔(|),例如: "user1|user2"。
⚠️注意:
如果需要在问题中指定知识库进行检索,可以通过该字段传入相关的标签值


返回参数

返回格式application/json,body参数如下:
参数名
类型
说明
id
string
此次请求的id
created
number
unix时间戳
choices
list
返回的回复, 当前仅有一个
choices[n].index
number
第几个回复
choices[n].finish_reason
string
"stop"表示正常结束,"sensitive"表示审核不通过"tool_fail"表示调用工具失败
choices[n].moderation_level
string
"1",表示需要结束会话; "2",表示需要撤回当前返回的内容
choices[n].message
json
返回的内容
choices[n].message.role
string
角色名称
choices[n].message.content
string
内容详情
choices[n].message.steps
list
助手的执行步骤
choices[n].message.steps[m].role
string
执行步骤中的角色名称,assistant表示模型,tool表示工具调用
choices[n].message.steps[m].content
string
执行步骤的结果,当角色为assistant时表示模型的输出内容,当角色为tool时表示工具的输出内容
choices[n].message.steps[m].tool_call_id
string
角色为tool时有效,内容为模型生成的工具调用中的唯一ID
choices[n].message.steps[m].tool_calls
list
模型生成的工具调用
choices[n].message.steps[m].tool_calls[i].id
string
工具调用的唯一ID
choices[n].message.steps[m].tool_calls[i].type
string
调用的工具类型,当前只支持function
choices[n].message.steps[m].tool_calls[i].function
object
具体调用的function
choices[n].message.steps[m].tool_calls[i].function.name
string
function名称
choices[n].message.steps[m].tool_calls[i].function.desc
string
function描述
choices[n].message.steps[m].tool_calls[i].function.type
string
function类型,当前支持tool/knowledge/workflow
choices[n].message.steps[m].tool_calls[i].function.arguments
string
调用function的参数,JSON格式
choices[n].message.steps[m].usage
object
当前执行步骤的token使用量
choices[n].message.steps[m].usage.prompt_tokens
number
问题token使用量
choices[n].message.steps[m].usage.completion_tokens
number
回答token使用量
choices[n].message.steps[m].usage.total_tokens
number
token总使用量
choices[n].message.steps[m].time_cost
number
当前执行步骤的耗时
choices[n].delta
json
返回的内容(流式返回)
choices[n].delta.role
string
角色名称,assistant表示模型,tool表示工具调用(流式返回)
choices[n].delta.content
string
内容详情,当角色为assistant时表示模型的输出内容,当角色为tool时表示工具的输出内容(流式返回)
choices[n].delta.tool_call_id
string
角色为tool时有效,内容为模型生成的工具调用中对应的tool_call ID (流式返回)
choices[n].delta.tool_calls
list
模型生成的工具调用(流式返回)
choices[n].delta.tool_calls[m].id
string
工具调用的唯一id(流式返回)
choices[n].delta.tool_calls[m].type
string
调用的工具类型,当前只支持function(流式返回)
choices[n].delta.tool_calls[m].function
object
具体调用的function(流式返回)
choices[n].delta.tool_calls[m].function.name
string
function名称(流式返回)
choices[n].delta.tool_calls[m].function.desc
string
function描述(流式返回)
choices[n].delta.tool_calls[m].function.type
string
function类型,当前支持tool/knowledge/workflow(流式返回)
choices[n].delta.tool_calls[m].function.arguments
string
调用function的参数,JSON格式(流式返回)
choices[n].delta.time_cost
number
当前执行步骤的耗时(流式返回)
assistant_id
string
实际使用的助手id
usage
object
token使用量
usage.prompt_tokens
number
问题token使用量
usage.completion_tokens
number
回答token使用量
usage.total_tokens
number
token总使用量


调用示例

a. 入参示例
{
"assistant_id": "I4aVQTHpsJro",
"user_id": "username",
"stream": true,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "你好"
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "您好! 有什么我可以帮助您的?"
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "帮我查询宝马3系和奔驰C级的价格?"
}
]
}
]
}
- Python3调用示例
import requests
import json

# 定义 API 的 URL
url = 'https://open.hunyuan.tencent.com/openapi/v1/agent/chat/completions'

# 定义请求头
headers = {
'X-Source': 'openapi',
'Content-Type': 'application/json',
'Authorization': 'Bearer <元器用户的appkey>'
}

# 定义请求体
data = {
"assistant_id": "I4aVQTHpsJro",
"user_id": "username",
"stream": False,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "能创建一个穿着古装的头像吗?"
}
]
}
]
}

# 将请求体转换为 JSON 格式的字符串
json_data = json.dumps(data)

# 发送 POST 请求
response = requests.post(url, headers=headers, json=data) # 使用 json 参数自动设置正确的 Content-Type

# 打印响应内容
print(response.text)
b. 流式返回示例
data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","tool_calls":[{"id":"call_Bhb3ii6hiXL7T33exEC4uLEq","type":"function","function":{"name":"YE7S7Dr7lmptszQ1","desc":"汽车知识库","kind":"knowledge","arguments":"{\"query\": \"宝马3系价格\"}"}}],"time_cost":1420}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"tool","content":"{\"outputList\":[{\"output\":\"宝马3系价格:30万\"}]}","tool_call_id":"call_Bhb3ii6hiXL7T33exEC4uLEq","time_cost":30}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "宝马"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "3"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "系"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "的"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "价格"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "是"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "30"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "万"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant", "content": "。"}}],"assistant_id":"xxx", "usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"现在"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"我"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"查询"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"一下"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"奔驰"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"C级"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"的"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"价格。"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"请"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"稍等"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"一下"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"。"}}],"assistant_id":"xxx","usage":{"prompt_tokens":64,"completion_tokens":43,"total_tokens":107}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","tool_calls":[{"id":"call_G8HVFFjeuXKdkzmusX0bXIxw","type":"function","function":{"name":"kZoEg875nOhn_search","desc":"搜狗搜索","type":"tool","arguments":"{\"keyword\": \"2024年奔驰C级价格\", \"returnCount\": 5}"}}],"time_cost":2250}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"tool","content":"{\"code\":0,\"msg\":\"success\",\"data\":[{\"url\":\"https://m.icauto.com.cn/baike/82/822773.html\",\"title\":\"\",\"content\":\"【车主指南新车动态】近日,2024款奔驰C级 长轴版正式上市,售价区间为33.32-37.65万元。与之前的车型相比,所有配置车型较上一代车型提高了500元,并新增了预防性安全系统和原厂天鹅绒脚垫。此外,每个不同的车型还额外增加了每月8-20GB的数据流量。(编辑:车主指南)\",\"date\":\"\"},{\"url\":\"https://chejiahao.autohome.com.cn/info/13450610\",\"title\":\"2024款奔驰C级上市,配置微调/涨价900元,售价33.32-37.65万元\",\"content\":\"10月17日,北京奔驰旗下新车——2024款 奔驰C级 正式上市.新车提供5款配置车型,售价33.32万-37.65万元.作为年度小改款车型,新车的外观及内饰并无发生明显改动,主要上调了售价(涨价900元),同时对配置进行了细微调整. \",\"date\":\"2023-10-17\"}]}","tool_call_id":"call_G8HVFFjeuXKdkzmusX0bXIxw","time_cost":120}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"奔驰"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"C级"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"的"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"价格"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"是"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"33.32-37.65"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"delta":{"index": 0,"role":"assistant","content":"万元。"}}],"assistant_id":"xxx","usage":{"prompt_tokens":154,"completion_tokens":83,"total_tokens":237}}

data: {"id":"xxx","created":"1695216235","choices":[{"index":0,"finish_reason":"stop","delta":{"role":"assistant"},"time_cost":1310}],"assistant_id":"xxx","usage":{"prompt_tokens":459,"completion_tokens":150,"total_tokens":609}}

data: [DONE]
c. 非流式的返回示例
{
"id": "xxxx",
"created": "",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "宝马3系的价格是30万。现在我查询一下奔驰C级的价格。请稍等一下。奔驰C级的价格是33.32-37.65万元。",
"steps": [
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "call_Bhb3ii6hiXL7T33exEC4uLEq",
"type": "function",
"function": {
"name": "YE7S7Dr7lmptszQ1",
"desc": "汽车知识库",
"type": "knowledge",
"arguments": "{\n \"query\": \"宝马3系价格\"\n}"
}
}
],
"usage": {
"prompt_tokens": 64,
"completion_tokens": 43,
"total_tokens": 107
},
"time_cost": 1420
},
{
"role": "tool",
"content": "{\"outputList\":[{\"output\":\"宝马3系价格:30万\"}]}",
"tool_call_id": "call_Bhb3ii6hiXL7T33exEC4uLEq",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"time_cost": 30
},
{
"role": "assistant",
"content": "宝马3系的价格是30万。现在我查询一下奔驰C级的价格。请稍等一下。",
"tool_calls": [
{
"id": "call_G8HVFFjeuXKdkzmusX0bXIxw",
"type": "function",
"function": {
"name": "kZoEg875nOhn_search",
"desc": "搜狗搜索",
"type": "tool",
"arguments": "{\"keyword\": \"2024年奔驰C级价格\", \"returnCount\": 5}"
}
}
],
"usage": {
"prompt_tokens": 154,
"completion_tokens": 83,
"total_tokens": 237
},
"time_cost": 2250
},
{
"role": "tool",
"content": "{\"code\":0,\"msg\":\"success\",\"data\":[{\"url\":\"https://m.icauto.com.cn/baike/82/822773.html\",\"title\":\"\",\"content\":\"【车主指南新车动态】近日,2024款奔驰C级 长轴版正式上市,售价区间为33.32-37.65万元。与之前的车型相比,所有配置车型较上一代车型提高了500元,并新增了预防性安全系统和原厂天鹅绒脚垫。此外,每个不同的车型还额外增加了每月8-20GB的数据流量。(编辑:车主指南)\",\"date\":\"\"},{\"url\":\"https://chejiahao.autohome.com.cn/info/13450610\",\"title\":\"2024款奔驰C级上市,配置微调/涨价900元,售价33.32-37.65万元\",\"content\":\"10月17日,北京奔驰旗下新车——2024款 奔驰C级 正式上市.新车提供5款配置车型,售价33.32万-37.65万元.作为年度小改款车型,新车的外观及内饰并无发生明显改动,主要上调了售价(涨价900元),同时对配置进行了细微调整. \",\"date\":\"2023-10-17\"}]}",
"tool_call_id": "call_G8HVFFjeuXKdkzmusX0bXIxw",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"time_cost": 120
},
{
"role": "assistant",
"content": "奔驰C级的价格是33.32-37.65万元。",
"usage": {
"prompt_tokens": 241,
"completion_tokens": 24,
"total_tokens": 265
},
"time_cost": 1310
}
]
}
}
],
"assistant_id": "xxx",
"usage": {
"prompt_tokens": 459,
"completion_tokens": 150,
"total_tokens": 609
}
}
d. 多模态智能体请求示例
{
"assistant_id": "xxx",
"user_id": "xxx",
"stream": false,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "你好"
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "您好! 有什么我可以帮助您的?"
}
]
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "把这张图换成沙漠背景"
},
{
"type": "image_url",
"image_url": {
"type": "image",
"url": "https://hunyuan-prod-1258344703.cos.ap-guangzhou.myqcloud.com/multimedia/a123bd6775b4d6a634a68887cb947cbb/20240508001350_Gfp-wisconsin-madison-the-nature-boardwalk.jpg?x-cos-security-token=1ytAbZ0sSGlcaYbMDIu4ahxKCj0Fq1Ca7270c9c1b1c0e31507e08efb24b2702c5yxE8BMaV53FDSpZnmzk1zTg3EdWmvnkTZJTnQ2P-dVPvKffujAspKRVnOjCepwoQaOmCxNfFgaOqpsqxGC4b85wMqlBt0MXCnj0V9mZLl8G_pLx_XMRBxGa8HgShlyohM_T5msHwRuOsgirGOaYy33AY1qjlmK7y9Jj7fRLgYe86HIa3JsPZp_snI_c8i_knaOmcPkpP5AdyQybonFxG5g_d0gK9sJZzISumXARBVS6NCw9L2bVcw7bm7e6oHm0PfTLGXqC9JzTSs0YMZ24aaTYrhq5bnQeV1efKWgF0l_1ngP5_cdSfisX38PYKMMoG1yMgugd9Pr8wWB7_56TxJeT_jzXsN8roTZYJfGqQvQ7AVai1x60tqci_Jx6FiOV-hFuLv3fBwbg2CX-FW8bQXYOQwTof-GAdQaYmRCMxDUCE7_iz8zbVn4lgNjVlG1P&q-sign-algorithm=sha1&q-ak=AKIDlc52v3bCPu7etNNKyUiodEFAa_drdgu6K07SoVe6oV4-c3rzzwrExNcie1onPuz8&q-sign-time=1715098441%3B1715099041&q-key-time=1715098441%3B1715099041&q-header-list=host&q-url-param-list=x-cos-security-token&q-signature=107e076ea18d0bcab095dec84d101e663daf6886"
}
}
]
}
]
}
e. 多模态智能体返回示例
{
"id": "xxxx",
"created": "",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "好的,我已经将背景更换为沙漠,你看这样是否满意?![沙漠背景图](https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg)",
"steps": [
{
"role": "assistant",
"content": "",
"tool_calls": [
{
"id": "call_Bhb3ii6hiXL7T33exEC4uLEq",
"type": "function",
"function": {
"name": "YE7S7Dr7lmptszQ1_generateImage",
"desc": "腾讯混元生图",
"type": "tool",
"arguments": "{\"image_url\": \"https://hunyuan-prod-1258344703.cos.ap-guangzhou.myqcloud.com/multimedia/a123bd6775b4d6a634a68887cb947cbb/20240508001350_Gfp-wisconsin-madison-the-nature-boardwalk.jpg?x-cos-security-token=1ytAbZ0sSGlcaYbMDIu4ahxKCj0Fq1Ca7270c9c1b1c0e31507e08efb24b2702c5yxE8BMaV53FDSpZnmzk1zTg3EdWmvnkTZJTnQ2P-dVPvKffujAspKRVnOjCepwoQaOmCxNfFgaOqpsqxGC4b85wMqlBt0MXCnj0V9mZLl8G_pLx_XMRBxGa8HgShlyohM_T5msHwRuOsgirGOaYy33AY1qjlmK7y9Jj7fRLgYe86HIa3JsPZp_snI_c8i_knaOmcPkpP5AdyQybonFxG5g_d0gK9sJZzISumXARBVS6NCw9L2bVcw7bm7e6oHm0PfTLGXqC9JzTSs0YMZ24aaTYrhq5bnQeV1efKWgF0l_1ngP5_cdSfisX38PYKMMoG1yMgugd9Pr8wWB7_56TxJeT_jzXsN8roTZYJfGqQvQ7AVai1x60tqci_Jx6FiOV-hFuLv3fBwbg2CX-FW8bQXYOQwTof-GAdQaYmRCMxDUCE7_iz8zbVn4lgNjVlG1P&q-sign-algorithm=sha1&q-ak=AKIDlc52v3bCPu7etNNKyUiodEFAa_drdgu6K07SoVe6oV4-c3rzzwrExNcie1onPuz8&q-sign-time=1715098441%3B1715099041&q-key-time=1715098441%3B1715099041&q-header-list=host&q-url-param-list=x-cos-security-token&q-signature=107e076ea18d0bcab095dec84d101e663daf6886\",\"prompt\":\"将背景更换为沙漠\"}"
}
}
],
"usage": {
"prompt_tokens": 641,
"completion_tokens": 753,
"total_tokens": 1394
},
"time_cost": 5420
},
{
"role": "tool",
"content": "{\"images\":[{\"image_url\":\"https://hunyuan-base-prod-1258344703.cos.ap-guangzhou.myqcloud.com/hunyuan_open/default/9f1521a7cd338bae16ce423fb0d1388c.png?q-sign-algorithm=sha1&q-ak=AKID0qSq0xJRL7h3A4nIYJFrFOJ1VlnbIm26&q-sign-time=1715098518;1746634518&q-key-time=1715098518;1746634518&q-header-list=host&q-url-param-list=&q-signature=bce46fe201817aafc0f43f4d43601a2612d69338\",\"prompt\":\"现实风格,一座木桥穿过青翠的草地,背景是无尽的沙漠,镜头是全景\",\"seed\":227926464}]}",
"tool_call_id": "call_Bhb3ii6hiXL7T33exEC4uLEq",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
},
"time_cost": 6710
},
{
"role": "assistant",
"content": "好的,我已经将背景更换为沙漠,你看这样是否满意?![沙漠背景图](https://hunyuan-base-prod-1258344703.cos.ap-guangzhou.myqcloud.com/hunyuan_open/default/9f1521a7cd338bae16ce423fb0d1388c.png?q-sign-algorithm=sha1&q-ak=AKID0qSq0xJRL7h3A4nIYJFrFOJ1VlnbIm26&q-sign-time=1715098518;1746634518&q-key-time=1715098518;1746634518&q-header-list=host&q-url-param-list=&q-signature=bce46fe201817aafc0f43f4d43601a2612d69338)",
"usage": {
"prompt_tokens": 1840,
"completion_tokens": 379,
"total_tokens": 2219
},
"time_cost": 4540
}
]
}
}
],
"assistant_id": "xxx",
"usage": {
"prompt_tokens": 2481,
"completion_tokens": 1132,
"total_tokens": 3613
}
}
错误码
序号
错误码
解释
1
400
请求参数错误
待补充
...
...