What you need
- An AWS account with a Bedrock model enabled, and its ID in
BEDROCK_MODEL_ID. - AWS credentials in your environment (
AWS_REGION,AWS_ACCESS_KEY_ID…), as for the rest of your code. - A Doconda API key in
DOCONDA_API_KEY. Create one in the dashboard, under API keys. - Python 3.9 or later, or Node 20 or later.
Build the agent
1
Install the dependencies
2
Connect the tools and ask for the Excel file
tools() returns Doconda’s tools (create_document, edit_document, convert_file, upload_file,
get_document…), each with a name, a description and a JSON Schema. Bedrock takes them as toolSpec. Create
agent.py (or agent.mts):stopReason == "tool_use"), you run
it and send the result back. In TypeScript, the AI SDK runs that loop for you.3
Run it
Result
The model callscreate_document with format: "xlsx". The tool waits until the file is ready and returns something
like this, which the model passes on in its reply:
get_document and gets fresh ones.
The tool returns only when the document is finished: about a minute at
quality: "fast", a few minutes at standard.Next steps
Use the Bedrock guide
The full integration, also with the Converse API in TypeScript.
Get Excel formulas right
What Doconda checks in a generated spreadsheet.
Call the Python SDK directly
Every method, to call Doconda without an agent.