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
@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
examples/bedrock_converse.py and examples/bedrock.ts.
Limits
- Only the Converse calls are intercepted;
invoke_modeland 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
boto31.40 and@aws-sdk/client-bedrock-runtime3.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.

