Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions open-sse/translator/request/openai-to-gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,13 @@ function wrapInCloudCodeEnvelopeForClaude(model, claudeRequest, credentials = nu
for (const block of msg.content) {
if (block.type === "text") {
parts.push({ text: block.text });
} else if (block.type === "image" && block.source) {
parts.push({
inlineData: {
mimeType: block.source.media_type,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The Gemini API and the existing helper functions in this repository (see convertOpenAIContentToParts in geminiHelper.ts) use mime_type (snake_case) rather than mimeType (camelCase) for image parts. To ensure compatibility and consistency with the rest of the translation logic, this should be changed to mime_type.

Suggested change
mimeType: block.source.media_type,
mime_type: block.source.media_type,

data: block.source.data,
},
});
} else if (block.type === "tool_use") {
parts.push({
functionCall: {
Expand Down