diff --git a/src/libs/agent-runtime/google/index.ts b/src/libs/agent-runtime/google/index.ts index 9dd296da4905..ed24b8c08ae2 100644 --- a/src/libs/agent-runtime/google/index.ts +++ b/src/libs/agent-runtime/google/index.ts @@ -91,7 +91,13 @@ export class LobeGoogleAI implements LobeRuntimeAI { .generateContentStream({ contents, systemInstruction: payload.system as string, - tools: this.buildGoogleTools(payload.tools), + tools: (() => { + const processedTools = this.buildGoogleTools(payload.tools); + if (model.startsWith('gemini-2.0')) { + return [...(processedTools || []), { googleSearch: {} }]; + } + return processedTools; + })(), }); const googleStream = convertIterableToStream(geminiStreamResult.stream);