fix(ai): switch grounding tool from GoogleSearchRetrieval to GoogleSearch

Gemini API no longer supports googleSearchRetrieval; requests fail with
INVALID_ARGUMENT. Replace with the google_search tool as required.
This commit is contained in:
2026-04-25 13:34:07 +02:00
parent bb3ab382e1
commit bc93213d16

View File

@@ -237,7 +237,7 @@ func (p *GeminiProvider) Chat(ctx context.Context, req *ChatRequest) (*ChatRespo
// Google Search grounding
if req.Grounded {
cfg.Tools = []*genai.Tool{
{GoogleSearchRetrieval: &genai.GoogleSearchRetrieval{}},
{GoogleSearch: &genai.GoogleSearch{}},
}
}