请求示例
curl --location --request POST 'http://192.168.25.17:3099/v1/chat/completions'
--header 'Authorization: Bearer app-xx'
--header 'Content-Type: application/json'
--data-raw '{
"model": "dify|Chat|http://192.168.25.17/v1/",
"stream": false,
"messages": [
{
"role": "system",
"content": "“有问题”或“没问题” You are a helpful assistant."
},
{
"role": "user",
"content": "你好"
}
]
}'
响应示例:
{
"id": "chatcmpl-JwnFmxkNhXKSzUUuRsHPHz9qrTaV0",
"object": "chat.completion",
"created": 1745750258,
"model": "dify|Chat|http://192.168.25.17/v1/",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "[object Object]"
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 3541,
"completion_tokens": 1954,
"total_tokens": 5495
},
"system_fingerprint": "fp_2f57f81c11"
}
正确的content应该是”1231“