Skip to main content
This tutorial shows you how to build an agent with Gemini on Vertex AI that creates a PowerPoint presentation from one sentence and replies with the download link. 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 one in the dashboard, under API keys.
  • Python 3.9 or later, or Node 20 or later.

Build the agent

1

Install the dependencies

2

Connect the tools and ask for the presentation

tools() returns Doconda’s tools (create_document, edit_document, convert_file, upload_file, get_document…), each with a name, a description and a JSON Schema. Gemini takes them as function declarations. Create agent.py (or agent.mts) and replace my-project with your project ID:
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.
3

Run it

Result

Gemini calls create_document with format: "pptx". The tool waits until the file is ready and returns something like this, which Gemini passes on in its reply:
You get the PowerPoint file, in 16:9 with native charts, and a PDF version. The links expire after 5 minutes; if the user asks for them later, the agent calls get_document and gets fresh ones.
The tool waits up to about 4 minutes for the finished document: about a minute at quality: "fast", a few minutes at standard. If it takes longer, it returns the id and status, and the model checks later with get_document.

Next steps

Use the Vertex AI guide

The full integration, also with @google/genai in TypeScript.

Return Office files from an LLM

Turn your model’s Markdown into Word, PowerPoint or Excel.

Call the Python SDK directly

Every method, to call Doconda without an agent.