googleapis / googleapis/nodejs-agentplatform

Invalid types when using google_search tool

Offen
#512 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: aiplatform priority: p2 type: bug
Vorherrschende Sprache
TypeScript
Sterne
182
Forks
69
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
10

Beschreibung

#### 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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den TypeScript-Fehler mit @google-cloud/vertexai v1.9.3 zu reproduzieren, und vergleiche das gültige google_search-Anfrageformat, auf das im Cookbook-Issue verwiesen wird. Verfolge die Tool-Typdefinitionen des Pakets und aktualisiere die relevanten Typen, damit die dokumentierte Anfrage ohne @ts-expect-error akzeptiert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
google-cloud, node.js, typescript
Bereich
api, tooling
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.