Default HARM_CATEGORY_CIVIC_INTEGRITY to OFF All models support either all BLOCK_NONE, or all OFF.

340be02777311339d95caeea3d7a3a7247908dd2

cloak1505 <170299980+cloak1505@users.noreply.github.com>

2 files changed, +1 -6Ignore whitespace
src/constants.js+1 -1
@@ -156,7 +156,7 @@ export const GEMINI_SAFETY = [
156 },156 },
157 {157 {
158 category: 'HARM_CATEGORY_CIVIC_INTEGRITY',158 category: 'HARM_CATEGORY_CIVIC_INTEGRITY',
159 threshold: 'BLOCK_NONE',159 threshold: 'OFF',
160 },160 },
161];161];
162162
src/endpoints/backends/chat-completions.js+0 -5
@@ -387,11 +387,6 @@ async function sendMakerSuiteRequest(request, response) {
387 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)) {387 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)) {
388 safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' }));388 safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' }));
389 }389 }
390 // Interestingly, Gemini 2.0 Flash does support setting the threshold for HARM_CATEGORY_CIVIC_INTEGRITY to OFF.
391 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)) {
392 safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'OFF' }));
393 }
394 // Most of the other models allow for setting the threshold of filters, except for HARM_CATEGORY_CIVIC_INTEGRITY, to OFF.
395390
396 if (enableWebSearch && !useMultiModal && !isGemma && !isLearnLM && !model.includes('gemini-2.0-flash-lite')) {391 if (enableWebSearch && !useMultiModal && !isGemma && !isLearnLM && !model.includes('gemini-2.0-flash-lite')) {
397 const searchTool = model.includes('1.5') || model.includes('1.0')392 const searchTool = model.includes('1.5') || model.includes('1.0')