build-on-aws/swift-bedrock-library
A Swift Library to create AI Agent based on Amazon Bedrock
TL;DR - Quick Start
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)")Installation
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)]
Documentation
📖 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
Examples
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
Acknowledgment
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.
Package Metadata
Repository: build-on-aws/swift-bedrock-library
Stars: 17
Forks: 2
Open issues: 6
Default branch: main
Primary language: swift
License: Apache-2.0
README: README.md