Skip to content

Commit

Permalink
Gemini change thinking
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaroran committed Dec 19, 2024
1 parent c937a65 commit 01da904
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ts/process/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'){
Expand All @@ -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
}]
})
Expand Down

0 comments on commit 01da904

Please sign in to comment.