From 01da904c9b9e55e9c68e270c0f35c1a6359e7e21 Mon Sep 17 00:00:00 2001 From: Kwaroran Date: Fri, 20 Dec 2024 03:14:06 +0900 Subject: [PATCH] Gemini change thinking --- src/ts/process/request.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ts/process/request.ts b/src/ts/process/request.ts index c7260155..d36cc9d9 100644 --- a/src/ts/process/request.ts +++ b/src/ts/process/request.ts @@ -1459,7 +1459,9 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise parts: geminiParts, }); } else if (prevChat?.role === qRole) { - reformatedChat[reformatedChat.length-1].parts[0].text += '\n' + chat.content + reformatedChat[reformatedChat.length-1].parts[ + reformatedChat[reformatedChat.length-1].parts.length-1 + ].text += '\n' + chat.content continue } else if(chat.role === 'system'){ @@ -1475,12 +1477,12 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise }) } } - else if(chat.role === 'assistant' && arg.modelInfo.flags.includes(LLMFlags.geminiThinking) && chat.thoughts?.length > 0){ + else if(chat.role === 'assistant' && arg.modelInfo.flags.includes(LLMFlags.geminiThinking)){ reformatedChat.push({ role: 'MODEL', - parts: [{ + parts: [chat.thoughts?.length > 0 ? { text: chat.thoughts.join('\n\n') - }, { + } : null, { text: chat.content }] })