传入多文档
POST
https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions' \
--header 'Authorization: Bearer {{DASHSCOPE_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "qwen-long",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "system",
"content": "{\"content\": \"百炼X1 搭载6.7英寸1440 x 3200像素超清屏幕...\n\", \"file_type\": \"pdf\", \"filename\": \"test_case_1\", \"title\": \"test_case_1\"}"
},
{
"role": "system",
"content": "{\"content\": \"星尘S9 Pro —— 创新视觉盛宴:突破性6.9英寸1440 x 3088像素...\n\", \"file_type\": \"pdf\", \"filename\": \"test_case_2\", \"title\": \"test_case_2\"}"
},
{"role": "user", "content": "这两篇文章讨论的产品有什么异同点?"}
],
"stream": true,
"stream_options": {
"include_usage": true
}
}'
响应示例响应示例
{}
请求参数
Header 参数
Authorization
string
必需
示例值:
Bearer {{DASHSCOPE_API_KEY}}
Content-Type
string
必需
示例值:
application/json
Body 参数application/json