| 421 | const prompt = convertGooglePrompt(request.body.messages, model, useSystemPrompt, getPromptNames(request)); | 421 | const prompt = convertGooglePrompt(request.body.messages, model, useSystemPrompt, getPromptNames(request)); |
| 422 | const safetySettings = [...GEMINI_SAFETY, ...(useVertexAi ? VERTEX_SAFETY : [])]; | 422 | const safetySettings = [...GEMINI_SAFETY, ...(useVertexAi ? VERTEX_SAFETY : [])]; |
| 423 | | 423 | |
| 424 | if (enableWebSearch && !enableImageModality && !isGemma && !isLearnLM && !noSearchModels.includes(model)) { | | |
| 425 | tools.push({ google_search: {} }); | | |
| 426 | } | | |
| 427 | | | |
| 428 | if (Array.isArray(request.body.tools) && request.body.tools.length > 0 && !enableImageModality && !isGemma) { | 424 | if (Array.isArray(request.body.tools) && request.body.tools.length > 0 && !enableImageModality && !isGemma) { |
| 429 | const functionDeclarations = []; | 425 | const functionDeclarations = []; |
| 430 | for (const tool of request.body.tools) { | 426 | for (const tool of request.body.tools) { |