Skip to main content
Connect your Google Vertex AI agent to Doconda so it can convert, create and edit Word, PowerPoint, Excel and PDF files. The SDK tools plug into Gemini function calling with google-genai in Python, or @ai-sdk/google-vertex and @google/genai in TypeScript.

Capabilities

  • Create a Word, PowerPoint, Excel or PDF file, or an artifact, from a request or from Markdown the agent wrote.
  • Edit a file: only what is asked changes, and get_report lists every change.
  • Convert a file to another format with no AI, for example any file to Markdown so the agent can read it.
  • Read what people saved in an artifact, such as poll votes.

Setup

This integration uses a Doconda API key in DOCONDA_API_KEY (from API keys). Google Cloud credentials come from your environment (gcloud auth application-default login or a service account), like the rest of your code.

With Python

The loop ends when Gemini stops calling functions; res.text includes the spreadsheet’s download links.

With the AI SDK

With @google/genai

The same loop as in Gemini, with vertexai: true:

Tools

The agent gets the eight Doconda tools; see the tools for what each one does. doconda.tools() returns them with name, description, a JSON Schema (inputSchema in TypeScript, input_schema in Python) and run; Gemini takes the schema as is in parametersJsonSchema (parameters_json_schema in Python). A failed call returns { "error": "<code>", "message": "…" } instead of raising, so the model can correct itself.

Troubleshooting

  • Doconda: pass api_key or set DOCONDA_API_KEY. — The SDK found no key (in TypeScript: Doconda: pass { apiKey } or set DOCONDA_API_KEY.). Set DOCONDA_API_KEY, or pass the key to Doconda.
  • Vertex AI can’t find the model — Check project and location: the model must be available in that region.
  • A tool result has "error": "insufficient_balance" — The project’s balance can’t cover the document: top up in the dashboard, or ask for quality: "fast".
  • The download link stopped working — File links expire after 5 minutes; the agent calls get_document for fresh ones.