doconda.tools() as Gemini functions on Vertex AI. 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.
Generate a spreadsheet from Gemini
- Authenticate with Google Cloud (
gcloud auth application-default loginor a service account) in 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 send back the result.
.xlsx and PDF links. 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), the assumptions in their own cells and no calculation errors, plus its PDF.
status:readyorfailed. A failed document isn’t charged.- Links expire after 5 minutes; Gemini 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, the same code without
vertexai=True, with a Gemini API key. See Gemini.Can I give it my own data for the spreadsheet?
Can I give it my own data for the spreadsheet?
Yes. Gemini uploads your files with
upload_file and passes them as sources: up to 5 documents (Word, PowerPoint,
Excel, PDF, TXT, Markdown or HTML), each up to 20 MB.Can it update a spreadsheet I already have?
Can it update a spreadsheet I already have?
Yes, with
edit_document: only what you ask for changes, and new cells use real formulas. An edit costs €0.30 at
standard.Where is the data processed?
Where is the data processed?
Doconda stores documents and files in the European Union (Ireland), and its AI also runs in the EU.
@google/genai, see Google Vertex AI.