Skip to content

[FEATURE] Add Bedrock structured output support #620

@llenodo

Description

@llenodo

Scope check

  • This is core LLM communication (not application logic)
  • This benefits most users (not just my use case)
  • This can't be solved in application code with current RubyLLM
  • I read the Contributing Guide

Due diligence

  • I searched existing issues
  • I checked the documentation

What problem does this solve?

#608 adds structured output support for the direct Anthropic API. Bedrock's Converse API also supports structured output but uses a different payload format — the schema must be stringified JSON nested under outputConfig.textFormat.structure.jsonSchema. Currently with_schema is not wired up for the Bedrock provider.

Proposed solution

Wire outputConfig into Bedrock's render_payload when a schema is provided, add supports_structured_output? to Bedrock model capability detection (Claude 4.5+), and add unit and integration tests with a VCR cassette.

Why this belongs in RubyLLM

Consistent support for structured outputs across providers — Bedrock is a core provider that should have parity with the direct Anthropic API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions