流式对话请求(Streaming)
POST
http://localhost:11434/api/chat
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:11434/api/chat' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "llama3.2",
"messages": [
{
"role": "user",
"content": "why is the sky blue?"
}
]
}'
响应示例响应示例
200 - Success - Success
{
"model": "llama3.2",
"created_at": "2023-08-04T08:52:19.385406455-07:00",
"message": {
"role": "assistant",
"content": "The",
"images": null
},
"done": false
}
请求参数
Body 参数application/json
返回响应
修改于 2025-03-26 10:29:44