What you need
- A Google Cloud project with Vertex AI enabled.
- Google Cloud credentials in your environment (
gcloud auth application-default loginor 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:3
Run it
Result
Gemini callscreate_document with format: "pptx". The tool waits until the file is ready and returns something
like this, which Gemini passes on in its reply:
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.