From 2d11b05e6cf5e543b6d818afe027d7b92e51e19d Mon Sep 17 00:00:00 2001 From: donmarble <59389660+donmarble@users.noreply.github.com> Date: Tue, 7 Jan 2025 23:45:01 +0900 Subject: [PATCH] fix: gemini multimodal text --- src/ts/process/request.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ts/process/request.ts b/src/ts/process/request.ts index b4ca7ea3..3a051961 100644 --- a/src/ts/process/request.ts +++ b/src/ts/process/request.ts @@ -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; -} \ No newline at end of file +}