-
Notifications
You must be signed in to change notification settings - Fork 67
400 INVALID_ARGUMENT error when attempting to use Function Calling with Vertex AI Search retrieval tool #426
Copy link
Copy link
Open
Labels
api: aiplatformIssues related to the googleapis/nodejs-vertexai API.Issues related to the googleapis/nodejs-vertexai API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Programming language: TS/JS
- OS: macOS
- Language runtime version: Typescript 5.6.2
- Package version:
1.7.0
Steps to reproduce
- Configure a Vertex AI generative model (
getGenerativeModel) with a function calling tool and a Vertex AI Search retrieval tool:
tools: [
{
functionDeclarations: [
{
name: "get_current_weather",
description: "get weather in a given location",
parameters: {
type: FunctionDeclarationSchemaType.OBJECT,
properties: {
location: { type: FunctionDeclarationSchemaType.STRING },
},
required: ["location"],
},
},
],
retrieval: {
vertexAiSearch: {
datastore: "<datastore>",
},
disableAttribution: false,
},
},
],- Create a ChatSession using
startChat() - Call
sendMessageStreamon a ChatSession
Error output
⨯ Internal error: ClientError: [VertexAI.ClientError]: got status: 400 Bad Request. {"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}
at throwErrorIfNotOK (./node_modules/@google-cloud/vertexai/build/src/functions/post_fetch_processing.js:32:27)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async generateContentStream (./node_modules/@google-cloud/vertexai/build/src/functions/generate_content.js:97:5)
digest: "3774699693"
Cause: GoogleApiError: Request contains an invalid argument.
at throwErrorIfNotOK (webpack-internal:///(action-browser)/./node_modules/@google-cloud/vertexai/build/src/functions/post_fetch_processing.js:32:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async generateContentStream (webpack-internal:///(action-browser)/./node_modules/@google-cloud/vertexai/build/src/functions/generate_content.js:97:5) {
code: 400,
status: 'INVALID_ARGUMENT',
errorDetails: undefined
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: aiplatformIssues related to the googleapis/nodejs-vertexai API.Issues related to the googleapis/nodejs-vertexai API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.