Default HARM_CATEGORY_CIVIC_INTEGRITY to OFF

All models support either all BLOCK_NONE, or all OFF.
This commit is contained in:
cloak1505
2025-04-26 18:43:56 -05:00
parent fc09be75a6
commit 340be02777
2 changed files with 1 additions and 6 deletions

View File

@ -156,7 +156,7 @@ export const GEMINI_SAFETY = [
}, },
{ {
category: 'HARM_CATEGORY_CIVIC_INTEGRITY', category: 'HARM_CATEGORY_CIVIC_INTEGRITY',
threshold: 'BLOCK_NONE', threshold: 'OFF',
}, },
]; ];

View File

@ -387,11 +387,6 @@ async function sendMakerSuiteRequest(request, response) {
if (['gemini-1.5-pro-001', 'gemini-1.5-flash-001', 'gemini-1.5-flash-8b-exp-0827', 'gemini-1.5-flash-8b-exp-0924'].includes(model)) { if (['gemini-1.5-pro-001', 'gemini-1.5-flash-001', 'gemini-1.5-flash-8b-exp-0827', 'gemini-1.5-flash-8b-exp-0924'].includes(model)) {
safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' })); safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' }));
} }
// Interestingly, Gemini 2.0 Flash does support setting the threshold for HARM_CATEGORY_CIVIC_INTEGRITY to OFF.
else if (['gemini-2.0-flash', 'gemini-2.0-flash-001', 'gemini-2.0-flash-exp', 'gemini-2.0-flash-exp-image-generation'].includes(model)) {
safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'OFF' }));
}
// Most of the other models allow for setting the threshold of filters, except for HARM_CATEGORY_CIVIC_INTEGRITY, to OFF.
if (enableWebSearch && !useMultiModal && !isGemma && !isLearnLM && !model.includes('gemini-2.0-flash-lite')) { if (enableWebSearch && !useMultiModal && !isGemma && !isLearnLM && !model.includes('gemini-2.0-flash-lite')) {
const searchTool = model.includes('1.5') || model.includes('1.0') const searchTool = model.includes('1.5') || model.includes('1.0')