Hello!
I'm trying grounding to google search but it seems like grounding doesn't work with function calling. If I have either of them defined in tools - model works. If I add both - I get 400 for any request:
ClientError: [VertexAI.ClientError]: got status: 400 Bad Request. {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}
The source code:
const generativeModel = vertex_ai.preview.getGenerativeModel({
model: model,
generationConfig: {
maxOutputTokens: 8192,
topP: 0.95,
temperature: 0.0
},
tools: [
{
googleSearchRetrieval: {
}
},
{
functionDeclarations: [
{
name: "someFun",
description: "Sample function",
parameters: {
type: FunctionDeclarationSchemaType.OBJECT,
properties: {
value: {
type: FunctionDeclarationSchemaType.STRING,
description: "Sample parameter"
}
},
required: ["value"]
}
}
]
}
],
});
Here is the sample project if you want to try:
https://github.com/motorro/GeminiGroundingTools
Is it expected?