feat(ollama): passthrough Claude Messages and OpenAI Responses - #7051
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe Ollama adaptor now supports Claude-format requests, OpenAI Responses requests, embeddings, Responses modes, and explicit relay-mode URL selection. Claude headers and response handling now use the Claude adaptor. ChangesOllama protocol support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant OllamaAdaptor
participant ClaudeAdaptor
participant OpenAIAdaptor
participant OllamaAPI
Client->>OllamaAdaptor: Submit relay request
alt Claude format
OllamaAdaptor->>ClaudeAdaptor: Convert request and configure URL
OllamaAdaptor->>ClaudeAdaptor: Apply headers
else OpenAI Responses mode
OllamaAdaptor->>OpenAIAdaptor: Convert request
else Other relay modes
OllamaAdaptor->>OllamaAdaptor: Select mode-specific URL and conversion
end
OllamaAdaptor->>OllamaAPI: Send converted request
OllamaAPI-->>OllamaAdaptor: Return response
alt Claude format
OllamaAdaptor->>ClaudeAdaptor: Handle response
else Responses modes
OllamaAdaptor->>OpenAIAdaptor: Handle response
else Embeddings mode
OllamaAdaptor->>OllamaAdaptor: Handle embedding response
else Other modes
OllamaAdaptor->>OllamaAdaptor: Handle stream or chat response
end
Suggested reviewers: Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
* feat: glm chanel /v1/responses (QuantumNous#7050) * feat(ollama): passthrough Claude Messages and OpenAI Responses (QuantumNous#7051) * docs: update PR template and remove PR Check workflow (QuantumNous#7053) * docs: update PR template and remove PR Check workflow * docs: add hidden agent issue and PR templates --------- Co-authored-by: Seefs <40468931+seefs001@users.noreply.github.com>
* feat: glm chanel /v1/responses (QuantumNous#7050) * feat(ollama): passthrough Claude Messages and OpenAI Responses (QuantumNous#7051) * docs: update PR template and remove PR Check workflow (QuantumNous#7053) * docs: update PR template and remove PR Check workflow * docs: add hidden agent issue and PR templates * fix(web): restore admin unbinding for built-in providers (QuantumNous#6987) * fix(web): align admin binding types Refs QuantumNous#6985 * test(web): restore animation mock * fix(billing): 修复时间规则恒真表达式导致倍率全天生效 (QuantumNous#6934) Co-authored-by: seefs001 <i@seefs.me> * fix(docker): add relaykit go.mod to dev build context (QuantumNous#7072) * feat(task): replace built-in task adaptors with a sandboxed JS plugin system (QuantumNous#7076) * fix(relay): 请求参数校验错误返回 HTTP 400 (QuantumNous#6774) * fix(relay): return 400 for invalid request parameters * fix(web): recheck setup status after page reload (QuantumNous#6968) * feat(auth): encrypt password login transport Closes QuantumNous#6743 --------- Co-authored-by: Seefs <40468931+seefs001@users.noreply.github.com> Co-authored-by: zcxads666 <128150298+zcxads666@users.noreply.github.com> Co-authored-by: seefs001 <i@seefs.me> Co-authored-by: Uladzislau <53997152+VladKabiak@users.noreply.github.com> Co-authored-by: Calcium-Ion <i@caion.me> Co-authored-by: Alex Xiang <ax2@zicode.com>
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
Ollama渠道类型 支持原生 /v1/messages 和 /v1/responses
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Summary by CodeRabbit
New Features
Bug Fixes