doconda.tools() as Gemini functions. When you ask for a
document, Gemini calls create_document with format: "docx" and you get an editable Word file and its PDF, with their
download links. The same works for a PowerPoint (pptx) or an Excel file (xlsx).
Steps
- Have your Gemini API key in the environment (
GEMINI_API_KEY), or use Vertex AI (below). - Put your Doconda API key (dashboard → API keys) in
DOCONDA_API_KEY. - Declare the tools and run the loop: while Gemini asks for functions, run them and hand back the result.
parametersJsonSchema (parameters_json_schema in Python) takes each tool’s JSON Schema as is.
On Vertex AI it’s the same code: new GoogleGenAI({ vertexai: true, project: "my-project", location: "europe-west1" })
in TypeScript or genai.Client(vertexai=True, project="my-project", location="europe-west1") in Python, with the
credentials from your Google Cloud environment.
What you get back
- A truly editable Word file: the look lives in the document’s styles (Normal, Heading 1…), plus its PDF.
status:ready,ready_with_warnings,needs_revieworfailed(not charged).- Links expire after 5 minutes; the agent gets fresh ones with
get_document.
FAQ
How do I generate a PowerPoint with Gemini?
How do I generate a PowerPoint with Gemini?
The same way: ask for a presentation (“Create a 5-slide presentation on our quarterly results”) and Gemini calls
create_document with format: "pptx". You get a 16:9 .pptx with native charts and its PDF.Can I use MCP instead of declaring the functions?
Can I use MCP instead of declaring the functions?
Yes, with
mcpToTool from @google/genai (experimental) and the remote server https://api.eu.doconda.com/mcp.
See Gemini.Can it edit a Word file I already have?
Can it edit a Word file I already have?
Yes: the agent uploads the file with
upload_file and calls edit_document, which changes only what you ask.How much does it cost?
How much does it cost?
You pay per delivered document; failed ones are not charged. See pricing.
Keep reading
- Gemini and Google Vertex AI: the full guides.
- Excel from Gemini on Vertex AI.
- Quickstart.