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

# PowerPoint from Gemini on Vertex AI

> How to make Gemini on Google Vertex AI create a PowerPoint presentation (.pptx) and return the download link.

You'll build an agent with Gemini on Vertex AI that creates a PowerPoint presentation from one sentence and gives you
the link to download it. Gemini decides when to call Doconda; you only wire up the tools.

## What you need

* A Google Cloud project with Vertex AI enabled.
* Google Cloud credentials in your environment (`gcloud auth application-default login` or a service account).
* A Doconda API key in `DOCONDA_API_KEY`. Create it in the dashboard, under **API keys**.
* Python 3.9+ or Node 20+.

## 1. Install the dependencies

<CodeGroup>
  ```bash Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  pip install google-genai doconda
  ```

  ```bash TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  npm install ai @ai-sdk/google-vertex @doconda/sdk
  ```
</CodeGroup>

## 2. Connect the tools and ask for the presentation

`tools()` returns Doconda's tools (create, upload, review, edit, look up…) with their name, description and JSON
Schema. Gemini takes them as function declarations. Replace `my-project` with your project id.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  from doconda import Doconda
  from google import genai
  from google.genai import types

  client = genai.Client(vertexai=True, project="my-project", location="europe-west1")
  tools = Doconda().tools()
  config = types.GenerateContentConfig(
      tools=[types.Tool(function_declarations=[
          types.FunctionDeclaration(name=t.name, description=t.description, parameters_json_schema=t.input_schema) for t in tools
      ])]
  )
  prompt = "Create a 5-slide PowerPoint about our quarterly results"
  contents = [types.Content(role="user", parts=[types.Part.from_text(text=prompt)])]

  while True:
      res = client.models.generate_content(model="gemini-3.5-flash", contents=contents, config=config)
      if not res.function_calls:
          break
      contents.append(res.candidates[0].content)
      parts = [
          types.Part.from_function_response(name=c.name, response={"result": next(t for t in tools if t.name == c.name).run(dict(c.args or {}))})
          for c in res.function_calls
      ]
      contents.append(types.Content(role="user", parts=parts))

  print(res.text)
  ```

  ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
  import { createVertex } from "@ai-sdk/google-vertex"
  import { generateText, isStepCount, jsonSchema, tool } from "ai"
  import { Doconda } from "@doconda/sdk"

  const vertex = createVertex({ project: "my-project", 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: "Create a 5-slide PowerPoint about our quarterly results",
  })

  console.log(text)
  ```
</CodeGroup>

In Python, the loop keeps going while Gemini asks for functions: you run each one and send the result back. In
TypeScript, the AI SDK runs that loop for you.

## Result

The `create_document` tool returns something like this to Gemini, and Gemini passes it on to the user in its reply:

```json theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
{
  "id": "doc_01JAB3…",
  "format": "pptx",
  "status": "ready",
  "links": { "pptx": "https://…", "pdf": "https://…" },
  "links_note": "Links expire in 5 minutes: call get_document for fresh ones."
}
```

You get the PowerPoint file (`.pptx`) and a PDF version. The links expire after 5 minutes; if the user asks for them
later, the agent calls `get_document` and gets new ones.

## Next steps

* [Google Vertex AI](/en/agents/vertex): the full guide, also with `@google/genai` in TypeScript.
* [Python SDK](/en/sdk/python): every method, in case you want to call Doconda without an agent.
* [Complete examples on GitHub](https://github.com/B-C-Software/doconda-examples).


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