修改 Ollama API 路由处理程序,使 /chat 和 /generate 端点能够接受 Content-Type 为 application/octet-stream 的请求。通过绕过 FastAPI 的自动请求验证机制,手动解析请求体,解决了 LiteLLM 客户端连接时出现的 422 错误。此更改保持了对现有 application/json 请求的向后兼容性。 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| document_routes.py | ||
| graph_routes.py | ||
| ollama_api.py | ||
| query_routes.py | ||