Add another ugli ahh list for no grounding models
| @@ -364,6 +364,7 @@ async function sendMakerSuiteRequest(request, response) { | |||
| 364 | 'gemini-2.0-flash-exp-image-generation', | 364 | 'gemini-2.0-flash-exp-image-generation', |
| 365 | ]; | 365 | ]; |
| 366 | 366 | ||
| 367 | // These models do not support setting the threshold to OFF at all. | ||
| 367 | const blockNoneModels = [ | 368 | const blockNoneModels = [ |
| 368 | 'gemini-1.5-pro-001', | 369 | 'gemini-1.5-pro-001', |
| 369 | 'gemini-1.5-flash-001', | 370 | 'gemini-1.5-flash-001', |
| @@ -374,6 +375,14 @@ async function sendMakerSuiteRequest(request, response) { | |||
| 374 | const thinkingBudgetModels = [ | 375 | const thinkingBudgetModels = [ |
| 375 | 'gemini-2.5-flash-preview-04-17', | 376 | 'gemini-2.5-flash-preview-04-17', |
| 376 | ]; | 377 | ]; |
| 378 | |||
| 379 | const noSearchModels = [ | ||
| 380 | 'gemini-2.0-flash-lite', | ||
| 381 | 'gemini-2.0-flash-lite-001', | ||
| 382 | 'gemini-2.0-flash-lite-preview-02-05', | ||
| 383 | 'gemini-1.5-flash-8b-exp-0924', | ||
| 384 | 'gemini-1.5-flash-8b-exp-0827', | ||
| 385 | ]; | ||
| 377 | // #endregion | 386 | // #endregion |
| 378 | 387 | ||
| 379 | if (!Array.isArray(generationConfig.stopSequences) || !generationConfig.stopSequences.length) { | 388 | if (!Array.isArray(generationConfig.stopSequences) || !generationConfig.stopSequences.length) { |
| @@ -391,12 +400,11 @@ async function sendMakerSuiteRequest(request, response) { | |||
| 391 | const prompt = convertGooglePrompt(request.body.messages, model, useSystemPrompt, getPromptNames(request)); | 400 | const prompt = convertGooglePrompt(request.body.messages, model, useSystemPrompt, getPromptNames(request)); |
| 392 | let safetySettings = GEMINI_SAFETY; | 401 | let safetySettings = GEMINI_SAFETY; |
| 393 | 402 | ||
| 394 | // These models do not support setting the threshold to OFF at all. | ||
| 395 | if (blockNoneModels.includes(model)) { | 403 | if (blockNoneModels.includes(model)) { |
| 396 | safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' })); | 404 | safetySettings = GEMINI_SAFETY.map(setting => ({ ...setting, threshold: 'BLOCK_NONE' })); |
| 397 | } | 405 | } |
| 398 | 406 | ||
| 399 | if (enableWebSearch && !enableImageModality && !isGemma && !isLearnLM && !model.includes('gemini-2.0-flash-lite')) { | 407 | if (enableWebSearch && !enableImageModality && !isGemma && !isLearnLM && !noSearchModels.includes(model)) { |
| 400 | const searchTool = model.includes('1.5') | 408 | const searchTool = model.includes('1.5') |
| 401 | ? ({ google_search_retrieval: {} }) | 409 | ? ({ google_search_retrieval: {} }) |
| 402 | : ({ google_search: {} }); | 410 | : ({ google_search: {} }); |