A Swift library for interacting with Amazon Bedrock foundation models.
📖 Complete Documentation - Comprehensive guides and API reference
import BedrockService
// Initialize the service
let bedrock = try await BedrockService(region: .uswest2)
// Send a simple text prompt
let model: BedrockModel = .nova_lite
let builder = try ConverseRequestBuilder(with: model)
.withPrompt("Tell me about rainbows")
let reply = try await bedrock.converse(with: builder)
print("Assistant: \(reply)")Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/build-on-aws/swift-bedrock-library.git", from: "1.5.0")
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "BedrockService", package: "swift-bedrock-library")
]
)
]Requires: platforms: [.macOS(.v15), .iOS(.v18), .tvOS(.v18)]
📖 Complete Documentation - Comprehensive guides and API reference
Key topics:
- Authentication - Configure AWS credentials
- Converse API - Conversational AI
- Image Generation - Create and modify images
- Tools - Function calling
- Streaming - Real-time responses
Explore the Examples directory for complete sample applications including:
- Basic conversation chat
- Streaming responses
- Image generation
- iOS math solver app
- Web playground with frontend/backend
This library and playground have been written by Mona Dierickx, during her last year of studies at HoGent, Belgium.
Thank you for your enthusiasm and positive attitude during the three months we worked together (February 2025 - May 2025).
Thank you Professor Steven Van Impe for allowing us to work with these young talents.