> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Vertex AI

> Genera Word, PowerPoint, Excel y PDF desde un agente con Google Vertex AI.

Las credenciales salen de tu entorno de Google Cloud (`gcloud auth application-default login` o una cuenta de
servicio), como en el resto de tu código.

## Con el AI SDK

```bash theme={null}
npm install ai @ai-sdk/google-vertex @doconda/sdk
```

```ts theme={null}
import { createVertex } from "@ai-sdk/google-vertex"
import { generateText, isStepCount, jsonSchema, tool } from "ai"
import { Doconda } from "@doconda/sdk"

const vertex = createVertex({ project: "mi-proyecto", location: "europe-west1" })
const doconda = new Doconda()
const tools = Object.fromEntries(
  doconda.tools().map((t) => [
    t.name,
    tool({ description: t.description, inputSchema: jsonSchema(t.inputSchema), execute: (input) => t.run(input as Record<string, unknown>) }),
  ]),
)

const { text } = await generateText({
  model: vertex("gemini-3.5-flash"),
  tools,
  stopWhen: isStepCount(5),
  prompt: "Crea una presentación de 5 diapositivas sobre nuestros resultados del trimestre",
})
```

## Con @google/genai

```bash theme={null}
npm install @google/genai @doconda/sdk
```

El mismo bucle que en [Gemini](/agents/gemini), con `vertexai: true`:

```ts theme={null}
import { type Content, GoogleGenAI } from "@google/genai"
import { Doconda } from "@doconda/sdk"

const ai = new GoogleGenAI({ vertexai: true, project: "mi-proyecto", location: "europe-west1" })
const tools = new Doconda().tools()
const contents: Content[] = [{ role: "user", parts: [{ text: "Hazme un Excel con el presupuesto del evento" }] }]

while (true) {
  const res = await ai.models.generateContent({
    model: "gemini-3.5-flash",
    contents,
    config: { tools: [{ functionDeclarations: tools.map((t) => ({ name: t.name, description: t.description, parametersJsonSchema: t.inputSchema })) }] },
  })
  if (!res.functionCalls?.length) break
  contents.push(res.candidates![0].content!)
  const parts = await Promise.all(
    res.functionCalls.map(async (call) => ({
      functionResponse: { name: call.name, response: { result: await tools.find((t) => t.name === call.name)!.run(call.args ?? {}) } },
    })),
  )
  contents.push({ role: "user", parts })
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.