Skip to main content
Declare the tools from doconda.tools() as Gemini function declarations and run the calls Gemini makes. When you ask for a document, Gemini calls create_document with format: "docx" and gets back download links to an editable Word file and its PDF. The same code makes a PowerPoint (pptx) or an Excel file (xlsx).

Steps

  1. Put your Gemini API key in GEMINI_API_KEY, or use Vertex AI (below).
  2. Put your Doconda API key (dashboard → API keys) in DOCONDA_API_KEY.
  3. Declare the tools and run the loop: while Gemini asks for functions, run them and hand back the result.
parameters_json_schema (parametersJsonSchema in TypeScript) takes each tool’s JSON Schema as is. On Vertex AI the code is the same with another client: genai.Client(vertexai=True, project="my-project", location="europe-west1") in Python or new GoogleGenAI({ vertexai: true, project: "my-project", location: "europe-west1" }) in TypeScript, with the credentials from your Google Cloud environment.

What you get back

create_document returns this summary to Gemini:
  • An editable Word file: the look lives in the document’s styles (Normal, Heading 1…), plus its PDF.
  • status: ready or failed. Failed documents are not charged.
  • Links expire after 5 minutes; Gemini gets fresh ones with get_document.

FAQ

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.
Yes, with mcpToTool from @google/genai (experimental) and the remote server https://api.eu.doconda.com/mcp. See Gemini.
Yes. Gemini uploads it with upload_file and calls edit_document, which changes only what you ask.
A document from a sentence costs €0.15 at fast, €0.50 at standard and €1.50 at best. Failed documents are not charged. See pricing.