Hi,
I can currently enable Google Search using the standard GoogleGenerativeAI provider like this:
const google = createGoogleGenerativeAI()
const { text } = await generateText({
model: aigateway(google('gemini-2.5-flash')),
prompt: 'hello world',
tools: {
google_search: google.tools.googleSearch({}),
},
})
However, I'm trying to achieve the same functionality while using a unified provider with a dynamic router. Since the tools are usually provider-specific, I'm not sure how to inject the Google Search tool into a unified model instance.
Current Implementation:
const unified = createUnified()
const model = aigateway(unified('dynamic/router'))
const { text } = await generateText({
model,
prompt: 'hello world',
// How to enable google_search here?
})
Could you please provide an example of how to implement this? Thanks!
Hi,
I can currently enable Google Search using the standard GoogleGenerativeAI provider like this:
However, I'm trying to achieve the same functionality while using a unified provider with a dynamic router. Since the tools are usually provider-specific, I'm not sure how to inject the Google Search tool into a unified model instance.
Current Implementation:
Could you please provide an example of how to implement this? Thanks!