Skip to content

How to enable Gemini's google_search tool? #1506

@Jouo

Description

@Jouo

Gemini API: https://ai.google.dev/gemini-api/docs/google-search#rest

By using curl I asked the date and it returned the correct answer, so my API Key permissions are fine.

However, in aichat with gemini:gemini-3.1-flash-lite-preview the same query returns a 2024 date, therefore the live web search tool is not being used.

config.yaml

clients:
  - type: gemini
    patch:
      tools:
        - google_search: {}

FWIW: I already tried different temperature values and supported gemini models.

What is the correct way to enable it?

EDIT: Does anyone know how to limit output tokens?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions