mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #3271 from tincansimagine/geminifeat2
Fix: Ensure "OFF" safety settings are applied to gemini-2.0-flash-exp for unfiltered responses
This commit is contained in:
@ -308,9 +308,15 @@ async function sendMakerSuiteRequest(request, response) {
|
|||||||
) && request.body.use_makersuite_sysprompt;
|
) && request.body.use_makersuite_sysprompt;
|
||||||
|
|
||||||
const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, getPromptNames(request));
|
const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, getPromptNames(request));
|
||||||
|
let safetySettings = GEMINI_SAFETY;
|
||||||
|
|
||||||
|
if (model.includes('gemini-2.0-flash-exp')) {
|
||||||
|
safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'OFF' }));
|
||||||
|
}
|
||||||
|
|
||||||
let body = {
|
let body = {
|
||||||
contents: prompt.contents,
|
contents: prompt.contents,
|
||||||
safetySettings: GEMINI_SAFETY,
|
safetySettings: safetySettings,
|
||||||
generationConfig: generationConfig,
|
generationConfig: generationConfig,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user