Merge pull request #3439 from sirius422/fix-old-gemini-models fix: adjust safetySettings handling for legacy Gemini models

0bcf8b5d21f8e6e1037c663ab69243ed32e45975

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
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.