1.10.0
Claude Opus 4.6 Support
Added support for Anthropic's latest Claude Opus 4.6 model, bringing enhanced reasoning capabilities and improved performance to your applications.
Model ID: anthropic.claude-opus-4-6-v1
Key Capabilities:
- Extended context window: 200,000 tokens
- Maximum output: 128,000 tokens
- Advanced reasoning with up to 8,191 reasoning tokens
- Full support for vision, document processing, and tool use
- Compatible with Converse API (streaming and non-streaming)
- Global cross-region inference support
Usage Example
Basic Conversation with Claude Opus 4.6
import BedrockService
import Logging
// Initialize the Bedrock service
let bedrock = try await BedrockService(
region: .useast1,
logger: Logger(label: "MyApp")
)
// Use the new Claude Opus 4.6 model
let model: BedrockModel = .claude_opus_v4_6
// Create a conversation request
let builder = try ConverseRequestBuilder(with: model)
.withPrompt("Explain quantum entanglement in simple terms")
.withTemperature(0.7)
.withMaxTokens(2048)
// Send the request and get the response
let reply = try await bedrock.converse(with: builder)
print("Assistant: \(reply)")Multi-turn Conversation
// Continue the conversation
let followUp = try ConverseRequestBuilder(from: builder, with: reply)
.withPrompt("Can you provide a real-world analogy?")
let secondReply = try await bedrock.converse(with: followUp)
print("Assistant: \(secondReply)")Using Advanced Reasoning
// Leverage Claude Opus 4.6's reasoning capabilities
let reasoningBuilder = try ConverseRequestBuilder(with: .claude_opus_v4_6)
.withPrompt("Solve this complex problem step by step: ...")
.withMaxTokens(8192)
// The model will automatically use reasoning tokens as needed
let solution = try await bedrock.converse(with: reasoningBuilder)
print("Solution: \(solution)")Streaming Responses
// Stream responses for real-time output
let streamBuilder = try ConverseRequestBuilder(with: .claude_opus_v4_6)
.withPrompt("Write a detailed explanation of machine learning")
for try await chunk in bedrock.converseStream(with: streamBuilder) {
if let text = chunk.text {
print(text, terminator: "")
}
}Installation
Update your Package.swift to use version 1.10.0:
dependencies: [
.package(url: "https://github.com/build-on-aws/swift-bedrock-library.git", from: "1.10.0")
]What's Changed
- Add support for Claude Opus 4.6 by @sebsto in #69
- Bump next from 15.4.10 to 16.1.5 in /Examples/web-playground/frontend by @dependabot[bot] in #68
Full Changelog: 1.9.0...1.10.0