-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
Description
Description
Meet API error when following the example: https://ai-sdk.dev/providers/ai-sdk-providers/google-generative-ai#combine-url-context-with-search-grounding
const result = generateText({
model: vertex('gemini-2.5-pro'),
messages: convertToModelMessages([message]),
tools: {
google_search: google.tools.googleSearch({}),
url_context: google.tools.urlContext({}),
},
});
terminal display server error of
APICallError [AI_APICallError]: The GenerateContentRequest proto is invalid:
* tools[0].tool_type: one_of 'tool_type' has more than one initialized field: google_search, url_context
....
data: {
error: {
code: 400,
message: 'The GenerateContentRequest proto is invalid:\n' +
" * tools[0].tool_type: one_of 'tool_type' has more than one initialized field: google_search, url_context",
status: 'INVALID_ARGUMENT'
}
},
AI SDK Version
- ai: 5.0.32
- @ai-sdk/google: 2.0.12
- @ai-sdk/google-vertex: 3.0.20
Code of Conduct
- I agree to follow this project's Code of Conduct