Skip to content
+

Generate Word, Excel, PowerPoint and PDF
with Amazon Bedrock

Bedrock reads documents. Doconda makes them.

Give your Amazon Bedrock agent Doconda's tools and it will deliver finished, editable, reviewed Word, Excel, PowerPoint and PDF files.

  • Your AWS credentials, as usual

    AWS credentials come from your environment (`AWS_REGION`, `AWS_ACCESS_KEY_ID`…), like the rest of your code. Doconda only needs its own key in `DOCONDA_API_KEY`.

  • Converse in Python or TypeScript

    In Python with `boto3`; in TypeScript with `ConverseCommand` from `@aws-sdk/client-bedrock-runtime`, or with `@ai-sdk/amazon-bedrock`. Each tool's schema goes in the Converse `toolSpec` as `inputSchema.json`.

  • A model enabled in your region

    `BEDROCK_MODEL_ID` must be a model enabled in your account and region that supports tool use in Converse; otherwise Bedrock rejects the ID. The loop ends when `stopReason` is no longer `tool_use`.

  1. 01Install the SDKpip install doconda or npm install @doconda/sdk, and your API key.
  2. 02Give your agent the toolsDoconda's tools, in Amazon Bedrock's format.
  3. 03Your agent delivers the fileYour agent gets the link to the reviewed file.
import boto3
from doconda import Doconda

bedrock = boto3.client("bedrock-runtime")
tools = Doconda().tools()
spec = [{"toolSpec": {"name": t.name, "description": t.description,
         "inputSchema": {"json": t.input_schema}}} for t in tools]
messages = [{"role": "user", "content": [{"text": "Make an Excel with the event budget"}]}]

res = bedrock.converse(modelId=MODEL_ID, messages=messages,
                       toolConfig={"tools": spec})
# the model asks for create_document → run it and send back the result
use = next(b["toolUse"] for b in res["output"]["message"]["content"] if "toolUse" in b)
out = next(t for t in tools if t.name == use["name"]).run(use["input"])
out["links"]  # {"xlsx": "https://…", "pdf": "https://…"}
+

Generate Word, Excel, PowerPoint and PDF
with Amazon Bedrock

Code

Python or TypeScript

Bedrock reads documents. Doconda makes them.

Give your Amazon Bedrock agent Doconda's tools and it will deliver finished, editable, reviewed Word, Excel, PowerPoint and PDF files.

  • Your AWS credentials, as usual

    AWS credentials come from your environment (`AWS_REGION`, `AWS_ACCESS_KEY_ID`…), like the rest of your code. Doconda only needs its own key in `DOCONDA_API_KEY`.

  • Converse in Python or TypeScript

    In Python with `boto3`; in TypeScript with `ConverseCommand` from `@aws-sdk/client-bedrock-runtime`, or with `@ai-sdk/amazon-bedrock`. Each tool's schema goes in the Converse `toolSpec` as `inputSchema.json`.

  • A model enabled in your region

    `BEDROCK_MODEL_ID` must be a model enabled in your account and region that supports tool use in Converse; otherwise Bedrock rejects the ID. The loop ends when `stopReason` is no longer `tool_use`.

  1. 01Install the SDKpip install doconda or npm install @doconda/sdk, and your API key.
  2. 02Give your agent the toolsDoconda's tools, in Amazon Bedrock's format.
  3. 03Your agent delivers the fileYour agent gets the link to the reviewed file.
import boto3
from doconda import Doconda

bedrock = boto3.client("bedrock-runtime")
tools = Doconda().tools()
spec = [{"toolSpec": {"name": t.name, "description": t.description,
         "inputSchema": {"json": t.input_schema}}} for t in tools]
messages = [{"role": "user", "content": [{"text": "Make an Excel with the event budget"}]}]

res = bedrock.converse(modelId=MODEL_ID, messages=messages,
                       toolConfig={"tools": spec})
# the model asks for create_document → run it and send back the result
use = next(b["toolUse"] for b in res["output"]["message"]["content"] if "toolUse" in b)
out = next(t for t in tools if t.name == use["name"]).run(use["input"])
out["links"]  # {"xlsx": "https://…", "pdf": "https://…"}

FAQ

Common questions

01 / 04

How do I generate a Word document from an Amazon Bedrock agent?

Install the SDK (pip install doconda or npm install @doconda/sdk), pass doconda.tools() as toolConfig in bedrock.converse and run the tool the model asks for. Doconda returns the link to the Word file and its PDF, which your agent shares with the user.

The document API for AI agents, ready for production.