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:
@@ -1555,9 +1555,17 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
parts: geminiParts,
|
parts: geminiParts,
|
||||||
});
|
});
|
||||||
} else if (prevChat?.role === qRole) {
|
} else if (prevChat?.role === qRole) {
|
||||||
reformatedChat[reformatedChat.length-1].parts[
|
if (reformatedChat[reformatedChat.length-1].parts[
|
||||||
reformatedChat[reformatedChat.length-1].parts.length-1
|
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
|
continue
|
||||||
}
|
}
|
||||||
else if(chat.role === 'system'){
|
else if(chat.role === 'system'){
|
||||||
@@ -2841,4 +2849,4 @@ export interface KoboldGenerationInputSchema extends KoboldSamplerSettingsSchema
|
|||||||
sampler_order?: number[];
|
sampler_order?: number[];
|
||||||
sampler_seed?: number;
|
sampler_seed?: number;
|
||||||
sampler_full_determinism?: boolean;
|
sampler_full_determinism?: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user