Gemini change thinking

This commit is contained in:
Kwaroran
2024-12-20 03:14:06 +09:00
parent c937a65b1f
commit 01da904c9b

View File

@@ -1459,7 +1459,9 @@ 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[0].text += '\n' + chat.content 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'){
@@ -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({ reformatedChat.push({
role: 'MODEL', role: 'MODEL',
parts: [{ parts: [chat.thoughts?.length > 0 ? {
text: chat.thoughts.join('\n\n') text: chat.thoughts.join('\n\n')
}, { } : null, {
text: chat.content text: chat.content
}] }]
}) })