| 308 | ) && request.body.use_makersuite_sysprompt; | 308 | ) && request.body.use_makersuite_sysprompt; |
| 309 | | 309 | |
| 310 | const prompt = convertGooglePrompt(request.body.messages, model, should_use_system_prompt, getPromptNames(request)); | 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 | let body = { | 317 | let body = { |
| 312 | contents: prompt.contents, | 318 | contents: prompt.contents, |
| 313 | safetySettings: GEMINI_SAFETY, | 319 | safetySettings: safetySettings, |
| 314 | generationConfig: generationConfig, | 320 | generationConfig: generationConfig, |
| 315 | }; | 321 | }; |
| 316 | | 322 | |
| | 323 | |
| 317 | if (should_use_system_prompt) { | 324 | if (should_use_system_prompt) { |
| 318 | body.system_instruction = prompt.system_instruction; | 325 | body.system_instruction = prompt.system_instruction; |
| 319 | } | 326 | } |