google-genai and doconda (or the AI SDK with @ai-sdk/google-vertex) and declare doconda.tools() as
Gemini functions. When you ask for a spreadsheet, Gemini calls create_document with format: "xlsx" and you get an
Excel file with real formulas and its PDF, with their download links.
Steps
- Authenticate with Google Cloud (
gcloud auth application-default loginor a service account) and have a project with Vertex AI enabled. - 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.
parameters_json_schema (parametersJsonSchema in @google/genai) takes each tool’s JSON Schema as is.
What you get back
- An Excel file with real formulas (not pasted numbers), with the assumptions in their own cells, and 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
Does it work with the Gemini API without Vertex AI?
Does it work with the Gemini API without Vertex AI?
Yes, it’s the same code without
vertexai=True. See the Gemini guide.Can I give it my own data for the spreadsheet?
Can I give it my own data for the spreadsheet?
Yes. Upload your files with
upload_file and the agent passes them as sources (up to 5 documents: Word,
PowerPoint, Excel, PDF, TXT or Markdown).Where is the data processed?
Where is the data processed?
Documents and files are stored in the European Union (Ireland), and the AI that processes them also runs in the EU.
How much does it cost?
How much does it cost?
You pay per delivered document; failed ones are not charged. See pricing.
Keep reading
- Google Vertex AI: the full guide, also with
@google/genai. - Quickstart.