带图像的对话请求(with Images)
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": "gpt-4",
"messages": [
{
"role": "user",
"content": "你好,请帮我解答这个问题",
"images": [
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
]
}
]
}'
响应示例响应示例
{
"model": "llava",
"created_at": "2023-12-13T22:42:50.203334Z",
"message": {
"role": "assistant",
"content": " The image features a cute, little pig with an angry facial expression. It's wearing a heart on its shirt and is waving in the air. This scene appears to be part of a drawing or sketching project.",
"images": null
},
"done": true,
"total_duration": 1668506709,
"load_duration": 1986209,
"prompt_eval_count": 26,
"prompt_eval_duration": 359682000,
"eval_count": 83,
"eval_duration": 1303285000
}
请求参数
Body 参数application/json
返回响应
修改于 2025-03-27 09:12:25