Skip to content

Commit 5b83f64

Browse files
committed
add converse stream example
1 parent 71a82ed commit 5b83f64

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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: "ConverseStream",
8+
platforms: [.macOS(.v15), .iOS(.v18), .tvOS(.v18)],
9+
products: [
10+
.executable(name: "ConverseStream", targets: ["ConverseStream"])
11+
],
12+
dependencies: [
13+
// for production use, uncomment the following line
14+
// .package(url: "https://github.com/build-on-aws/swift-bedrock-library.git", branch: "main"),
15+
16+
// for local development, use the following line
17+
.package(name: "swift-bedrock-library", path: "../.."),
18+
19+
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"),
20+
],
21+
targets: [
22+
// Targets are the basic building blocks of a package, defining a module or a test suite.
23+
// Targets can depend on other targets in this package and products from dependencies.
24+
.executableTarget(
25+
name: "ConverseStream",
26+
dependencies: [
27+
.product(name: "BedrockService", package: "swift-bedrock-library"),
28+
.product(name: "Logging", package: "swift-log"),
29+
]
30+
)
31+
]
32+
)

Examples/converse/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ let package = Package(
1212
dependencies: [
1313
// for production use, uncomment the following line
1414
// .package(url: "https://github.com/build-on-aws/swift-bedrock-library.git", branch: "main"),
15-
15+
1616
// for local development, use the following line
1717
.package(name: "swift-bedrock-library", path: "../.."),
18-
18+
1919
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"),
2020
],
2121
targets: [

Examples/converse/Sources/Converse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ struct Main {
3232
let bedrock = try await BedrockService(
3333
region: .useast1,
3434
logger: logger
35-
// uncomment if you use SSO with AWS Identity Center
36-
// authentication: .sso
35+
// uncomment if you use SSO with AWS Identity Center
36+
// authentication: .sso
3737
)
3838

3939
// select a model that supports the converse modality

0 commit comments

Comments
 (0)