doconda.tools() as the toolConfig of the Bedrock Converse API, and run each tool the model asks
for with run(). When you ask for a Word document, the model calls create_document with format: "docx" and gets
back download links to the .docx and its PDF.
Steps
- Enable a model in your Bedrock account and put its ID in
BEDROCK_MODEL_ID. AWS credentials come from your environment (AWS_REGION,AWS_ACCESS_KEY_ID…). - Create a Doconda API key in the dashboard (API keys) and put it in
DOCONDA_API_KEY. - Run the Converse loop: while
stopReasonistool_use, run the tool and hand the result back to the model.
What you get back
create_document returns a short summary to the model, which passes it on to the user:
links: the editable Word file and its PDF. They expire after 5 minutes; the model gets fresh ones withget_document.status:readyorfailed. Failed documents are not charged.- When a call fails, the tool returns
{ "error": "<code>", "message": "…" }instead of raising, so the model can read it and react.
FAQ
Does it work with any Bedrock model?
Does it work with any Bedrock model?
With any model enabled in your account that supports tool use in the Converse API. The tools are standard JSON
Schema.
Can I ask for a PowerPoint or an Excel file with the same code?
Can I ask for a PowerPoint or an Excel file with the same code?
Yes.
create_document also makes PDF (pdf), PowerPoint (pptx) and Excel (xlsx) files; the model picks
format from what the user asks.How much does it cost?
How much does it cost?
The same as the API: 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.Where are the documents stored?
Where are the documents stored?
In the European Union (Ireland), and the AI that processes them also runs in the EU.
Related
- Amazon Bedrock: the full guide, also with the AI SDK.
- How do I generate a PowerPoint from Amazon Bedrock?