fix veo3 - #2140
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThis PR adds Gemini video proxy support by introducing a stored API key flow in the Task model. It creates a new video_proxy_gemini.go module for URL resolution, extends the Task struct with a PrivateData field to store Gemini API keys populated during task initialization, adds a ConvertToOpenAIVideo method to the Gemini adaptor for format conversion, and expands the relay task builder to handle Gemini channels. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant VideoProxy as video_proxy.go
participant GeminiResolver as video_proxy_gemini.go
participant TaskDB as Task Model
participant GeminiAPI as Gemini API
Client->>VideoProxy: GET /video/{task_id}
VideoProxy->>TaskDB: Fetch Task with PrivateData
TaskDB-->>VideoProxy: Task + PrivateData.Key
alt API Key Exists
VideoProxy->>GeminiResolver: getGeminiVideoURL(channel, task, apiKey)
GeminiResolver->>TaskDB: Extract URL from task data
alt URL Found in Data
GeminiResolver-->>VideoProxy: videoURL
else Fetch from Relay
GeminiResolver->>GeminiAPI: Retrieve task via relay adaptor
GeminiAPI-->>GeminiResolver: TaskResult with RemoteUrl/payload
GeminiResolver->>GeminiResolver: Parse nested structures (uri, response, generateVideoResponse, videos, etc.)
GeminiResolver-->>VideoProxy: videoURL + apiKey appended
end
VideoProxy->>GeminiAPI: Proxy request with x-goog-api-key header
GeminiAPI-->>Client: Video response
else Missing Key
VideoProxy-->>Client: HTTP 500 - API key not stored
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
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 |
Summary by CodeRabbit
New Features
Bug Fixes
Chores