| 308 | 308 | ) && request.body.use_makersuite_sysprompt; |
| 309 | 309 | |
| 310 | 310 | const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, getPromptNames(request)); |
| 311 | + let safetySettings = GEMINI_SAFETY; |
| 312 | + |
| 313 | + if (model.includes('gemini-2.0-flash-exp')) { |
| 314 | + safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'OFF' })); |
| 315 | + } |
| 316 | + |
| 311 | 317 | let body = { |
| 312 | 318 | contents: prompt.contents, |
| 313 | 319 | safetySettings: GEMINI_SAFETYsafetySettings, |
| 314 | 320 | generationConfig: generationConfig, |
| 315 | 321 | }; |
| 316 | 322 | |
| 323 | + |
| 317 | 324 | if (should_use_system_prompt) { |
| 318 | 325 | body.system_instruction = prompt.system_instruction; |
| 319 | 326 | } |