Skip to content

feat(rig-bedrock): add structured output support via Converse API#1667

Open
jdwil wants to merge 1 commit into0xPlaygrounds:mainfrom
jdwil:feat/bedrock-structured-output
Open

feat(rig-bedrock): add structured output support via Converse API#1667
jdwil wants to merge 1 commit into0xPlaygrounds:mainfrom
jdwil:feat/bedrock-structured-output

Conversation

@jdwil
Copy link
Copy Markdown

@jdwil jdwil commented Apr 25, 2026

Map rig's output_schema to Bedrock's outputConfig.textFormat on both converse() and converse_stream() requests. This enables models that support structured output (e.g. Claude Sonnet 4.5, Haiku 4.5) to return JSON conforming to a caller-provided schema.

  • Add output_config() method to AwsCompletionRequest that converts schemars::Schema to Bedrock's OutputConfig with JsonSchemaDefinition, extracting the schema name from the title field (falling back to "response_schema")
  • Wire set_output_config() into both completion and streaming builders
  • Bump minimum aws-sdk-bedrockruntime to 1.124.0 (first version with OutputConfig types, released 2026-02-04)
  • Add tests for output_config conversion

Map rig's `output_schema` to Bedrock's `outputConfig.textFormat` on
both `converse()` and `converse_stream()` requests. This enables
models that support structured output (e.g. Claude Sonnet 4.5,
Haiku 4.5) to return JSON conforming to a caller-provided schema.

- Add `output_config()` method to `AwsCompletionRequest` that converts
  `schemars::Schema` to Bedrock's `OutputConfig` with
  `JsonSchemaDefinition`, extracting the schema name from the title
  field (falling back to "response_schema")
- Wire `set_output_config()` into both completion and streaming builders
- Bump minimum `aws-sdk-bedrockruntime` to 1.124.0 (first version
  with `OutputConfig` types, released 2026-02-04)
- Add tests for output_config conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants