googleapis / googleapis/nodejs-agentplatform

Invalid types when using google_search tool

Open
#512 0 comments 0 reactions 0 assignees View on GitHub
api: aiplatform priority: p2 type: bug
Dominant language
TypeScript
Stars
182
Forks
69
Avg merge
1d 8h
Merged PRs (30d)
10

Description

#### Environment details

- Programming language: Typescript
- OS: MacOS 15.3.2 (24D81)
- Language runtime version: NodeJS v22.13.0
- Package version: v1.9.3

#### Steps to reproduce

1. Install @google-cloud/vertexai (v1.9.3 is latest at time of writing)
2. Attempt to use tool `googleSearchRetrieval`, which is indicated in the provided package types (this will return an API error).

Image

3. Found this issue on the Cookbook repo that provided the valid API request format: https://github.com/google-gemini/cookbook/issues/436#issuecomment-2641778212
4. Types are invalid

```
const researchModel = vertexAIUSEast1.getGenerativeModel({
model: 'models/gemini-2.0-flash-001',
systemInstruction: systemPrompt,
tools: [
{
google_search: {},
},
],
})
```

```
Object literal may only specify known properties, and 'google_search' does not exist in type 'Tool'.ts(2353)
```

Image

I'm able to bypass this with `@ts-expect-error` but the package types should be updated.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.