fix: add support for inline base64 image data in image block

This commit is contained in:
suyao 2025-05-11 03:50:05 +08:00
parent 9b2992fce4
commit dfeb54fd94
No known key found for this signature in database

View File

@ -153,6 +153,16 @@ export default class GeminiProvider extends BaseProvider {
} }
} }
} }
const file = imageBlock.file
if (file) {
const base64Data = await window.api.file.base64Image(file.id + file.ext)
parts.push({
inlineData: {
data: base64Data.base64,
mimeType: base64Data.mime
} as Part['inlineData']
})
}
} }
const fileBlocks = findFileBlocks(message) const fileBlocks = findFileBlocks(message)