fix(vertex): convert Claude format request for Gemini models in Verte…#3405
fix(vertex): convert Claude format request for Gemini models in Verte…#3405togawa-sakiko wants to merge 1 commit intoQuantumNous:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Problem
When routing a Claude-format request (
/v1/messages) through a Vertex channel with a Gemini model, the request was sent to the Gemini endpoint still in Anthropic format, causing an error.Root Cause
ConvertClaudeRequestin the Vertex adaptor always returned the request as Anthropic format (viacopyRequest), regardless ofRequestMode. It lacked theRequestModeGeminibranch thatConvertOpenAIRequestalready handles correctly.Fix
Add a
RequestModeGeminibranch inConvertClaudeRequestthat delegates togemini.Adaptor.ConvertClaudeRequest, which performs the correct Claude → (OpenAI →) Gemini conversion.Summary by CodeRabbit
Release Notes