Skip to content

Commit df7df1f

Browse files
authored
Merge repos swift fm playground and swift bedrock library (#12)
1 parent 3bd0627 commit df7df1f

File tree

186 files changed

+13010
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+13010
-165
lines changed

.github/workflows/build_soundness.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
name: Build And Soundness checks
1+
name: Build, tests & soundness checks
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44

55
jobs:
6-
build:
6+
swift-bedrock-library:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout repository
1010
uses: actions/checkout@v4
1111
- name: Run tests
12-
working-directory: backend
12+
working-directory: swift-bedrock-library
13+
run: swift test
14+
15+
playground-backend:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
- name: Web playground backend tests
21+
working-directory: web-playground/backend
1322
run: swift build
1423

1524
soundness:

.gitignore

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,40 @@ Package.resolved
1414
.env
1515
Makefile
1616

17-
# backend
18-
backend/.DS_Store
19-
backend/.build
20-
backend/.swiftpm
21-
backend/.devContainer
22-
backend/Packages
23-
backend/*.xcodeproj
24-
backend/xcuserdata/
25-
backend/.vscode/*
26-
backend/!/.vscode/hummingbird.code-snippets
27-
backend/.env.*
28-
backend/.env
29-
backend/img/generated_images
30-
backend/.vscode
31-
backend/Makefile
32-
33-
# frontend
34-
frontend/node_modules
35-
frontend/.pnp
36-
frontend/.pnp.js
37-
frontend/.yarn/install-state.gz
38-
39-
frontend/coverage
40-
41-
frontend/.next/
42-
frontend/out/
43-
44-
frontend/build
45-
46-
frontend/.DS_Store
47-
frontend/*.pem
48-
49-
frontend/npm-debug.log*
50-
frontend/yarn-debug.log*
51-
frontend/yarn-error.log*
52-
53-
frontend/.env*.local
54-
55-
frontend/.vercel
56-
57-
frontend/*.tsbuildinfo
58-
frontend/next-env.d.ts
59-
frontend/Makefile
17+
node_modules
18+
19+
# **/backend
20+
**/backend/.DS_Store
21+
**/backend/.build
22+
**/backend/.swiftpm
23+
**/backend/.devContainer
24+
**/backend/Packages
25+
**/backend/*.xcodeproj
26+
**/backend/xcuserdata/
27+
**/backend/.vscode/*
28+
**/backend/!/.vscode/hummingbird.code-snippets
29+
**/backend/.env.*
30+
**/backend/.env
31+
**/backend/img/generated_images
32+
**/backend/.vscode
33+
**/backend/Makefile
34+
35+
# **/frontend
36+
**/frontend/node_modules
37+
**/frontend/.pnp
38+
**/frontend/.pnp.js
39+
**/frontend/.yarn/install-state.gz
40+
**/frontend/coverage
41+
**/frontend/.next/
42+
**/frontend/out/
43+
**/frontend/build
44+
**/frontend/.DS_Store
45+
**/frontend/*.pem
46+
**/frontend/npm-debug.log*
47+
**/frontend/yarn-debug.log*
48+
**/frontend/yarn-error.log*
49+
**/frontend/.env*.local
50+
**/frontend/.vercel
51+
**/frontend/*.tsbuildinfo
52+
**/frontend/next-env.d.ts
53+
**/frontend/Makefile

.licenseignore

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
**/*.md
88
CONTRIBUTORS.txt
99
LICENSE.txt
10+
LICENSE
1011
NOTICE.txt
1112
Package.swift
1213
Package@swift-*.swift
@@ -31,10 +32,9 @@ Package.resolved
3132
*.yaml
3233
*.yml
3334
*.json
34-
*.gif
35-
frontend/*
35+
**/*.gif
36+
**/*.png
37+
**/frontend/*
38+
**/*.code-snippets
3639
.DS_Store
37-
backend/.vscode/hummingbird.code-snippets
38-
backend/img/image.png
39-
LICENSE
40-
.licenseignore
40+
.licenseignore
File renamed without changes.

.vscode/launch.json

Lines changed: 0 additions & 94 deletions
This file was deleted.

Package.swift

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// swift-tools-version: 6.1
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "SwiftBedrockLibrary",
8+
platforms: [.macOS(.v15), .iOS(.v18), .tvOS(.v18)],
9+
products: [
10+
.library(name: "BedrockService", targets: ["BedrockService"]),
11+
.library(name: "BedrockTypes", targets: ["BedrockTypes"]),
12+
],
13+
dependencies: [
14+
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
15+
.package(url: "https://github.com/awslabs/aws-sdk-swift", from: "1.3.3"),
16+
.package(url: "https://github.com/smithy-lang/smithy-swift", from: "0.118.0"),
17+
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"),
18+
.package(url: "https://github.com/awslabs/aws-crt-swift", from: "0.5.0"),
19+
],
20+
targets: [
21+
.target(
22+
name: "BedrockService",
23+
dependencies: [
24+
.target(name: "BedrockTypes"),
25+
.product(name: "AWSClientRuntime", package: "aws-sdk-swift"),
26+
.product(name: "AWSBedrock", package: "aws-sdk-swift"),
27+
.product(name: "AWSBedrockRuntime", package: "aws-sdk-swift"),
28+
.product(name: "Smithy", package: "smithy-swift"),
29+
.product(name: "Logging", package: "swift-log"),
30+
.product(name: "AwsCommonRuntimeKit", package: "aws-crt-swift"),
31+
],
32+
path: "swift-bedrock-library/Sources/BedrockService"
33+
),
34+
.target(
35+
name: "BedrockTypes",
36+
dependencies: [
37+
.product(name: "AWSBedrockRuntime", package: "aws-sdk-swift"),
38+
.product(name: "AWSBedrock", package: "aws-sdk-swift"),
39+
.product(name: "Smithy", package: "smithy-swift"),
40+
],
41+
path: "swift-bedrock-library/Sources/BedrockTypes"
42+
),
43+
.testTarget(
44+
name: "BedrockServiceTests",
45+
dependencies: [
46+
.target(name: "BedrockService"),
47+
.target(name: "BedrockTypes"),
48+
],
49+
path: "swift-bedrock-library/Tests/BedrockServiceTests"
50+
),
51+
.testTarget(
52+
name: "BedrockTypesTests",
53+
dependencies: [
54+
.target(name: "BedrockTypes")
55+
],
56+
path: "swift-bedrock-library/Tests/BedrockTypesTests"
57+
),
58+
]
59+
)

README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,46 @@
1-
# Swift FM Playground
1+
# Amazon Bedrock Swift Library and web playground
22

3-
Welcome to the Swift Foundation Model (FM) Playground, an example app to explore how to use **Amazon Bedrock** with the AWS SDK for Swift.
3+
This repository contains projects demonstrating how to use [Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) with Swift.
44

5-
> 🚨 **Important:** This application is for educational purposes and not intended for production use.
5+
## Projects
66

7-
## Overview
7+
### 1. Swift Bedrock Library
88

9-
> 🚧 Under construction 🚧
9+
A tiny layer on top of the [AWS SDK for Swift](https://github.com/awslabs/aws-sdk-swift) for interacting with Amazon Bedrock foundation models. This library provides a convenient way to access Amazon Bedrock's capabilities from Swift applications.
1010

11-
## Prerequisites
11+
[Go to Swift Bedrock Library →](swift-bedrock-library/README.md)
12+
13+
### 2. Swift FM Playground
14+
15+
An interactive web application that demonstrates the capabilities of Amazon Bedrock foundation models using the Swift Bedrock Library. The playground includes:
16+
17+
- A Swift "backend for frontend" that interfaces with Amazon Bedrock
18+
- A React frontend for interacting with the models through a user-friendly interface
1219

13-
> 🚧 Under construction 🚧
20+
[Go to Swift FM Playground →](swift-fm-playground/web-playground/README.md)
1421

15-
## Running the Application
22+
## Getting Started
1623

17-
> 🚧 Under construction 🚧
24+
Each project has its own README with specific setup instructions:
25+
26+
- For the Swift Bedrock Library, see the [library README](swift-bedrock-library/README.md)
27+
- For the Swift FM Playground, see the [playground README](swift-fm-playground/web-playground/README.md)
28+
29+
## Prerequisites
1830

19-
## Accessing the Application
31+
- Swift 6.0 or later
32+
- AWS account with access to Amazon Bedrock
33+
- [AWS credentials configured locally](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) or [SSO configured with AWS Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/manage-your-accounts.html) configured
2034

21-
To access the application, open `http://localhost:3000` in your web browser.
35+
## Acknowledgment
2236

23-
## Stopping the Application
37+
This library and playground have been written by [Mona Dierickx](https://www.linkedin.com/in/mona-dierickx/), during her last year of studies at [HoGent](https://www.hogent.be/), Belgium.
2438

25-
To halt the application, you will need to stop both the backend and frontend processes.
39+
Thank you for your enthousiasm and positive attitude during the three months we worked together. (February 2025 - May 2025).
2640

27-
### Stopping the Frontend
41+
Thank for Professor Steven Van Impe for allowing us to work with these young talents.
2842

29-
In the terminal where the frontend is running, press `Ctrl + C` to terminate the process.
3043

31-
### Stopping the Backend
44+
## License
3245

33-
Similarly, in the backend terminal, use the `Ctrl + C` shortcut to stop the server.
46+
These projects are licensed under the Apache License 2.0. See the LICENSE files in each project for details.

0 commit comments

Comments
 (0)