googleapis / googleapis/nodejs-agentplatform

Invalid types when using google_search tool

Aperta
#512 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
api: aiplatform priority: p2 type: bug
Lingua principale
TypeScript
Stelle
182
Fork
69
Merge medio
1g 8h
PR unite (30g)
10

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo l’errore TypeScript con @google-cloud/vertexai v1.9.3 e confronta il formato valido della richiesta google_search a cui si fa riferimento nell’issue di Cookbook. Traccia le definizioni dei tipi Tool del pacchetto e aggiorna i tipi pertinenti in modo che la richiesta documentata venga accettata senza @ts-expect-error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
google-cloud, node.js, typescript
Ambito
api, tooling
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.