Skip to content

Releases: build-on-aws/swift-bedrock-library

1.0.1

20 Aug 20:38
8088ade
Compare
Choose a tag to compare

What's Changed

  • Fix iOS demo by updating project.pbxproj with correct dependencies by @sebsto in #39

Full Changelog: 1.0.0...1.0.1

1.0.0

20 Aug 20:00
f9b0704
Compare
Choose a tag to compare

Swift Bedrock Library v1.0.0

We're excited to announce the initial release of the Swift Bedrock Library - a lightweight wrapper around the AWS SDK for Swift that provides an idiomatic and concise Swift way to access Amazon Bedrock foundation models.

Features

Authentication

  • Multiple authentication methods: default AWS credentials, profiles, SSO, web identity tokens, API keys, and static credentials
  • Seamless integration with AWS credential provider chain
  • Support for iOS, tvOS, and macOS applications with web identity authentication and Sign in with Apple

Converse API

  • Text Generation: Send text prompts with customizable inference parameters (temperature, maxTokens, topP, stopSequences)
  • Vision: Analyze images with vision-capable models using JPEG, PNG, GIF, and WebP formats
  • Document Processing: Process PDF, CSV, DOC, DOCX, XLS, XLSX, HTML, TXT, and MD documents
  • Tool Usage: Define and use custom tools with JSON schema validation
  • Reasoning: Access model reasoning with configurable token limits
  • Streaming: Real-time streaming responses with detailed progress tracking

Image Generation

  • Text-to-Image: Generate images from text descriptions
  • Image Variations: Create variations of existing images
  • Configurable parameters: resolution, quality, CFG scale, seed, negative prompts

Text Completion (InvokeModel API)

  • Direct text completion with model-specific parameters
  • Support for various inference configurations

Supported Models

  • Amazon Nova (Lite, Micro, Pro, Canvas)
  • Anthropic Claude (3.5 Sonnet, 3.5 Haiku, 3 Opus, 3 Sonnet, 3 Haiku)
  • Meta Llama models
  • Cohere Command models
  • AI21 Labs Jamba models
  • Mistral AI models

Platform Support

  • macOS: 15.0+
  • iOS: 18.0+
  • tvOS: 18.0+

Installation

Add to your Package.swift:

dependencies: [
    .package(url: "https://github.com/build-on-aws/swift-bedrock-library.git", branch: "main")
]

Quick Start

import BedrockService

let bedrock = try await BedrockService(region: .uswest2)
let models = try await bedrock.listModels()

let builder = try ConverseRequestBuilder(with: .nova_lite)
    .withPrompt("Tell me about Swift programming")

let reply = try await bedrock.converse(with: builder)
print("Assistant: \(reply)")

Acknowledgments

This library was developed by Mona Dierickx during her studies at HoGent, Belgium, with special thanks to Professor Steven Van Impe.


For complete documentation and examples, visit our GitHub repository.