Menu ▾ ▴

#23 Add `bedrock` (AWS Bedrock Converse) provider to `orko-providers` crate

open
nobody
2026-08-22
2026-08-22
Anonymous
No

Originally created by: SAMAD101

Summary

AWS Bedrock support in orko-providers via the Converse / ConverseStream API. This is the heaviest provider on the list: a new codec (Converse JSON, not OpenAI-shaped) and a signing requirement (SigV4) that stresses the transport trait from [#3].

Why it's not a preset

  • Wire format: Converse request/response (messages with content blocks, toolConfig, inferenceConfig) — closer to the Anthropic codec (#6) than to OpenAI.
  • Streaming: ConverseStream returns AWS event-stream binary framing (application/vnd.amazon.eventstream), not SSE — needs its own frame parser (prior art: the aws-smithy-eventstream crate; decide vendor-vs-depend in the PR).
  • Auth: every request must be SigV4-signed (region + service bedrock). Two options, decide in the PR:
  • a SignedTransport wrapper implementing the [#3] transport trait, signing before send (keeps the codec pure — preferred if the trait exposes enough of the request), or
  • depend on aws-sdk-bedrockruntime behind a bedrock feature and adapt its output to CompletionStream (fastest to correct, heavier dep tree).

Spec

  • Feature-gated: bedrock (off by default).
  • Credentials: standard AWS chain (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN, profile, IMDS), region from AWS_REGION.
  • from_str examples: "bedrock:anthropic.claude-sonnet-4-20250514-v1:0" — model ids contain :; first-:-only split keeps the id intact (add a test).
  • Map Converse content blocks / toolUse / toolResult / stop reasons / usage onto orko-core types; unsupported block types error, not panic.

Acceptance

  • Default build of orko-providers compiles none of this.
  • Codec unit tests: request JSON for a tools+system prompt case; response mapping incl. toolUse and usage.
  • Event-stream frame parse test from a captured ConverseStream fixture.
  • One #[ignore]d live integration test.
  • clippy -D warnings clean with and without the feature.

Depends on [#3] (transport trait shape). Related: [#6] (content-block mapping precedent).

Related

Tickets: #3
Tickets: #6

Discussion


Log in to post a comment.