data:开头的报错| 状态码 | 场景 | 响应体示例 |
|---|---|---|
| 缺少 X-User-ID 请求头 | {"detail": [{"loc": ["header", "x-user-id"], ...}]} | |
| 请求体验证失败(question 为空、top_k 超范围等) | {"detail": [{"loc": ["body", "question"], ...}]} | |
| 400 | 指定的文档尚未完成索引 | {"detail": "以下文档尚未完成索引: [1, 2]"} |
| 404 | 指定的 document_ids 不存在或不属于当前用户 | {"detail": "文档不存在: [999]"} |
Content-Type: text/event-stream data: {"role": "assistant", "content": "第一个"}
data: {"role": "assistant", "content": "文本块"}
...
data: [DONE]data: {"role": "assistant", "content":"抱歉,未能在您的学习资料中找到相关内容。请确保已上传相关文档并完成索引。"}