Js调用cozeAPI(v2和v3版本)
·
cozeAPI官方文档:扣子
v2
curl --location 'https://api.coze.cn/open_api/v2/chat' \
--header 'Authorization: Bearer pat_vpjxq05nflaMYavcrRgklNKueSKEbQ1ddnUYjmDsBAubvmUBqSr4WGlZ0TGq****' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host;' \
--header 'Connection: keep-alive' \
--data '{
"bot_id": "747349265604416****",
"user": "123456789",
"stream": true,
"query":"What day is it today", //问题
}
}'
v3
curl --location 'https://api.coze.cn/v3/chat' \
--header 'Authorization: Bearer pat_vpjxq05nflaMYavcrRgklNKueSKEbQ1ddnUYjmDsBAubvmUBqSr4WGlZ0TGq****' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host;' \
--header 'Connection: keep-alive' \
--data '{
"bot_id": "747349265604416****",
"user_id": "123456789",
"stream": true,
"auto_save_history":true,
"additional_messages":[
{
"role":"user",
"content":"What day is it today",
"content_type":"text"
}
]
}'
V2和V3最主要的区别:
1.请求体:user_id和user, additional_messages和query
2.V3中增加DeepSeek R1的深度思考内容(使用v2请求相同coze,获取不到思考的内容)
更多推荐


所有评论(0)