fix: adjust safetySettings handling for legacy and experimental Gemini models - gemini-1.5-flash-8b-exp-0827 - gemini-1.5-flash-8b-exp-0924 - gemini-pro - gemini-1.0-pro

f32938981c146a6d94d264a87e078ef9ef40db43

sirius422 <sirius42@gfw.moe>

1 files changed, +1 -1Ignore whitespace
src/endpoints/backends/chat-completions.js+1 -1
@@ -318,7 +318,7 @@ async function sendMakerSuiteRequest(request, response) {
318318 let safetySettings = GEMINI_SAFETY;
319319
320320 // These old models do not support setting the threshold to OFF at all.
321321 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', 'gemini-pro', 'gemini-1.0-pro', 'gemini-1.0-pro-001'].includes(model)) {
322322 safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' }));
323323 }
324324 // Interestingly, Gemini 2.0 Flash does support setting the threshold for HARM_CATEGORY_CIVIC_INTEGRITY to OFF.