Code
Python or TypeScript
Gemini decides. Doconda delivers the file.
Connect Doconda with Gemini function calling (@google/genai) and get finished, editable, reviewed Word, Excel, PowerPoint and PDF files.
- 01Install the SDKpip install doconda or npm install @doconda/sdk, and your API key.
- 02Give your agent the toolsDoconda's tools, in Gemini's format.
- 03Your agent delivers the fileYour agent gets the link to the reviewed file.

import { type Content, GoogleGenAI } from "@google/genai"
import { Doconda } from "@doconda/sdk"
const ai = new GoogleGenAI({})
const tools = new Doconda().tools()
const contents: Content[] = [{ role: "user", parts: [{ text: "Hazme un Excel con el presupuesto del evento" }] }]
while (true) {
const res = await ai.models.generateContent({
model: "gemini-3.8-flash",
contents,
config: { tools: [{ functionDeclarations: tools.map((t) => ({ name: t.name, description: t.description, parametersJsonSchema: t.inputSchema })) }] },
})
if (!res.functionCalls?.length) {
console.log(res.text)
break
}
contents.push(res.candidates![0].content!)
const parts = await Promise.all(
res.functionCalls.map(async (call) => ({
functionResponse: { name: call.name, response: { result: await tools.find((t) => t.name === call.name)!.run(call.args ?? {}) } },
})),
)
contents.push({ role: "user", parts })
}
