This commit is contained in:
based 2024-04-11 16:51:05 +10:00
parent 34bca69950
commit c4ec97aa50
2 changed files with 3 additions and 3 deletions

View File

@ -252,8 +252,8 @@ async function sendMakerSuiteRequest(request, response) {
};
function getGeminiBody() {
let should_use_system_prompt = model === 'gemini-1.5-pro-latest' && request.body.use_makersuite_sysprompt;
let prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt);
const should_use_system_prompt = model === 'gemini-1.5-pro-latest' && request.body.use_makersuite_sysprompt;
const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt);
let body = {
contents: prompt.contents,
safetySettings: GEMINI_SAFETY,

View File

@ -276,7 +276,7 @@ function convertGooglePrompt(messages, model, useSysPrompt = false) {
}
}
const system_instruction = { parts: { text: sys_prompt }};
const system_instruction = { parts: { text: sys_prompt.trim() }};
const contents = [];
messages.forEach((message, index) => {