Summary
Amazon Bedrock now supports native structured outputs — the ability to constrain model responses to a defined JSON schema at the API level. This is available across four APIs: Converse, ConverseStream, InvokeModel, and InvokeModelWithResponseStream.
Currently, ChatBedrockConverse.with_structured_output() achieves structured output exclusively through forced tool calling — wrapping the schema as a tool, forcing the model to call it, and parsing the output. The new native API feature offers guaranteed schema compliance without this workaround.
What Bedrock now supports
Two complementary mechanisms:
1. JSON Schema output format
A new outputConfig.textFormat parameter on the Converse/ConverseStream APIs (and analogous parameters on InvokeModel/InvokeModelWithResponseStream):
{
"outputConfig": {
"textFormat": {
"type": "json_schema",
"structure": {
"jsonSchema": {
"schema": "{...}",
"name": "data_extraction",
"description": "..."
}
}
}
}
}
2. Strict tool use
A new strict: true flag on tool definitions that enforces schema compliance on tool call inputs:
{
"toolSpec": {
"name": "get_weather",
"strict": true,
"inputSchema": { "json": { ... } }
}
}
Both mechanisms are documented in the Bedrock API reference and user guide.
Supported models
Native structured outputs is only available for select models:
- Anthropic: Claude Haiku 4.5, Claude Sonnet 4.5, Claude Opus 4.5, Claude Opus 4.6
- Open-weight: Select Qwen, DeepSeek, Mistral, Google Gemma, NVIDIA Nemotron, MiniMax, Moonshot, and OpenAI models
Notably not supported: Claude 3.x models, Llama, Titan, Cohere, AI21, etc. See the Bedrock docs for the full list.
Current gaps in langchain-aws
| Feature |
Bedrock API |
langchain-aws |
outputConfig.textFormat (JSON schema) |
Available |
Not implemented |
strict: true on tool definitions |
Available |
Not implemented |
with_structured_output via forced tool calling |
N/A (workaround) |
Implemented |
Proposed changes
- Add
outputConfig support to ChatBedrockConverse — new constructor parameter and inclusion in _converse_params().
- Add
strict flag support in tool formatting — pass through strict: true in _format_tools() / bind_tools() when specified.
- Update
with_structured_output() — prefer native outputConfig for supported models, fall back to forced tool calling for others. Design decision: whether to gate by a hardcoded model list or let the Bedrock API surface errors for unsupported models.
- Tests — add unit and integration tests for both mechanisms, extending the existing structured output test suite.
Related issues
Implementing native structured outputs would address or help resolve all three.
References
Summary
Amazon Bedrock now supports native structured outputs — the ability to constrain model responses to a defined JSON schema at the API level. This is available across four APIs: Converse, ConverseStream, InvokeModel, and InvokeModelWithResponseStream.
Currently,
ChatBedrockConverse.with_structured_output()achieves structured output exclusively through forced tool calling — wrapping the schema as a tool, forcing the model to call it, and parsing the output. The new native API feature offers guaranteed schema compliance without this workaround.What Bedrock now supports
Two complementary mechanisms:
1. JSON Schema output format
A new
outputConfig.textFormatparameter on the Converse/ConverseStream APIs (and analogous parameters on InvokeModel/InvokeModelWithResponseStream):{ "outputConfig": { "textFormat": { "type": "json_schema", "structure": { "jsonSchema": { "schema": "{...}", "name": "data_extraction", "description": "..." } } } } }2. Strict tool use
A new
strict: trueflag on tool definitions that enforces schema compliance on tool call inputs:{ "toolSpec": { "name": "get_weather", "strict": true, "inputSchema": { "json": { ... } } } }Both mechanisms are documented in the Bedrock API reference and user guide.
Supported models
Native structured outputs is only available for select models:
Notably not supported: Claude 3.x models, Llama, Titan, Cohere, AI21, etc. See the Bedrock docs for the full list.
Current gaps in langchain-aws
outputConfig.textFormat(JSON schema)strict: trueon tool definitionswith_structured_outputvia forced tool callingProposed changes
outputConfigsupport toChatBedrockConverse— new constructor parameter and inclusion in_converse_params().strictflag support in tool formatting — pass throughstrict: truein_format_tools()/bind_tools()when specified.with_structured_output()— prefer nativeoutputConfigfor supported models, fall back to forced tool calling for others. Design decision: whether to gate by a hardcoded model list or let the Bedrock API surface errors for unsupported models.Related issues
strictpass-through onbind_tools_converse_params()crashes on unexpectedstrictkwargwith_structured_outputfails for open-weight models that don't support forced tool callingImplementing native structured outputs would address or help resolve all three.
References