1.13.0
What's New
Structured output — Constrain Claude responses (and tool inputs) to conform to a JSON schema. The model is forced to return a value that matches the schema, removing the need for post-processing or retry-on-malformed-JSON loops.
let schema: JSON = [
"type": "object",
"properties": [
"title": ["type": "string"],
"summary": ["type": "string"],
"tags": ["type": "array", "items": ["type": "string"]],
],
"required": ["title", "summary"],
]
let output = try OutputFormat(name: "Article", schema: schema)
let builder = try ConverseRequestBuilder(with: .claude_sonnet_v4_5)
.withPrompt("Summarize WWDC 2026")
.withOutputFormat(output)
let reply = try await bedrock.converse(with: builder)This adds:
OutputFormat— a new struct with JSON schema validation and a memorable name; converts cleanly to the AWS SDK type.ConverseRequestBuilder.withOutputFormat(...)— fluent API for both regular and streaming requests.- A
strict: Boolparameter onToolso tool-call inputs can be constrained the same way. - A new
.structuredOutputcase onConverseFeature, enabled for Anthropic Claude models. - A new DocC article and a
Examples/structured-output/example demonstrating both mechanisms, wired into the CI integration-tests matrix.
Closes #70.
What's Changed
Full Changelog: 1.12.0...1.13.0