Skip to main content
wrap() (Python, over a boto3 bedrock-runtime client) and wrapBedrock() (TypeScript, over a BedrockRuntimeClient) intercept converse and converse_stream (ConverseCommand and ConverseStreamCommand) so they get the context and record the answer. Every other method passes through untouched.

Install

The TypeScript integration ships with @niadra/sdk 0.3.0, ready on main and on npm when it is published; until then the npm package is 0.1.1.

The five primitives

Minimal example

The same code is in examples/bedrock_converse.py and examples/bedrock.ts.

Limits

  • Only the Converse calls are intercepted; invoke_model and the rest of the client pass through untouched.
  • Outside a conversation or task block, calls pass through untouched, and nothing the wrapper does can fail the call.
  • Tested against boto3 1.40 and @aws-sdk/client-bedrock-runtime 3.1140 with the transport replaced and Niadra on the emulator.

Next steps

Strands Agents

the AWS agent framework, through hooks.

Anthropic

the same for the Messages API.