Skip to content

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

1.6.0

21 Oct 07:51
b3a7fb7

Choose a tag to compare

Add support for embeddings, with Titan Embeddings v2 model.
All the infrastructure is now in place to add other embeddings models easily (Cohere,...)

1.5.0

13 Oct 08:11
4b66fb3

Choose a tag to compare

What's Changed

  • Add an error case to handle InvalidGrant exception by @sebsto in #50

Full Changelog: 1.4.0...1.5.0

1.4.0

12 Oct 22:54
eb4abea

Choose a tag to compare

  • Expose Usage and Metrics in the ResponseMetaData. These type were previously internal and not usable from client applications.
  • expose a new InputIsTooLong error based on Bedrock's ValidationError
  • expose some properties as public
  • add functions to History
  • add precondition checks on ConverseRequestBuilder.withHistory()

What's Changed

  • Expose usage and metrics in metadata by @sebsto in #48
  • Add new error cases and fix properties access & history by @sebsto in #49

Full Changelog: 1.3.0...1.4.0

1.3.0

12 Oct 18:09
ad70683

Choose a tag to compare

Expose max prompt size to the BedrockModel API.
This allows agent and client applications to track the size of the history sent to the model and to take action when we're getting close to the maximum prompt size supported.

What's Changed

  • Expose max prompt size to the model API by @sebsto in #47

Full Changelog: 1.2.0...1.3.0

1.2.0

12 Oct 12:12
f2f1583

Choose a tag to compare

While developing the AgentKit library, we realised that some API changes were required to make the life of developers easier.

  • History is not a type alias of [Message] anymore. It is promoted to its own History top-level struct.
    All functions using [Messages] in their signature are marked deprecated and we have added new functions signatures with History.

  • ConverseRequestBuilder is now Sendable. It allows user to pass it between isolation boundaries.

We took the occasion to iron out the JSON structure as well. It doesn't use Any (which is unsafe) anymore.

What's Changed

  • Try to fix compiler crash when running JSONTest by @sebsto in #44
  • [fix] JSON encoding did not remove the top level "value" by @sebsto in #45
  • API Changes to create AgentKit by @sebsto in #46

Full Changelog: 1.1.1...1.2.0

1.1.1

30 Sep 15:23
abad720

Choose a tag to compare

What's Changed

  • Improve JSON by removing Any? by @sebsto in #43
  • fix CI test suite

Full Changelog: 1.1.0...1.1.1

1.1.0

29 Sep 20:50
8c38668

Choose a tag to compare

What's Changed

  • Add support for claude sonnet 4.5 by @sebsto in #42
  • A couple of minor API changes around Sendable and Encodable by @sebsto in #41
  • Bump next from 15.2.4 to 15.4.7 in /Examples/web-playground/frontend by @dependabot[bot] in #40

Full Changelog: 1.0.1...1.1.0

1.0.1

20 Aug 20:38
8088ade

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

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.