fix: gemini multimodal (#712)

# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
fix gemini multimodal error.
ERROR MESSAGE : Invalid value at 'contents[6].parts[1]' (oneof), oneof
field 'data' is already set. Cannot set 'text'
This commit is contained in:
kwaroran
2025-01-11 01:44:30 +09:00
committed by GitHub

View File

@@ -1555,9 +1555,17 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
parts: geminiParts,
});
} else if (prevChat?.role === qRole) {
reformatedChat[reformatedChat.length-1].parts[
if (reformatedChat[reformatedChat.length-1].parts[
reformatedChat[reformatedChat.length-1].parts.length-1
].text += '\n' + chat.content
].inlineData) {
reformatedChat[reformatedChat.length-1].parts.push({
text: chat.content,
})
} else {
reformatedChat[reformatedChat.length-1].parts[
reformatedChat[reformatedChat.length-1].parts.length-1
].text += '\n' + chat.content
}
continue
}
else if(chat.role === 'system'){
@@ -2841,4 +2849,4 @@ export interface KoboldGenerationInputSchema extends KoboldSamplerSettingsSchema
sampler_order?: number[];
sampler_seed?: number;
sampler_full_determinism?: boolean;
}
}