Skip to content

Commit 2edcf29

Browse files
committed
add swift-bedrock-library
1 parent c07086d commit 2edcf29

File tree

115 files changed

+12951
-0
lines changed

Some content is hidden

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

115 files changed

+12951
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@@===----------------------------------------------------------------------===@@
2+
@@
3+
@@ This source file is part of the Swift Foundation Models Playground open source project
4+
@@
5+
@@ Copyright (c) YEARS Amazon.com, Inc. or its affiliates
6+
@@ and the Swift Foundation Models Playground project authors
7+
@@ Licensed under Apache License v2.0
8+
@@
9+
@@ See LICENSE.txt for license information
10+
@@ See CONTRIBUTORS.txt for the list of Swift Foundation Models Playground project authors
11+
@@
12+
@@ SPDX-License-Identifier: Apache-2.0
13+
@@
14+
@@===----------------------------------------------------------------------===@@
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.gitignore
2+
.swiftformatignore
3+
.spi.yml
4+
.swift-format
5+
.github/*
6+
*.md
7+
**/*.md
8+
CONTRIBUTORS.txt
9+
LICENSE.txt
10+
NOTICE.txt
11+
Package.swift
12+
Package@swift-*.swift
13+
Package.resolved
14+
**/*.docc/*
15+
**/.gitignore
16+
**/Package.swift
17+
**/Package.resolved
18+
**/docker-compose*.yaml
19+
**/docker/*
20+
**/.dockerignore
21+
**/Dockerfile
22+
**/Makefile
23+
**/*.html
24+
**/*-template.yml
25+
**/*.xcworkspace/*
26+
**/*.xcodeproj/*
27+
**/*.xcassets/*
28+
**/*.appiconset/*
29+
.mailmap
30+
.swiftformat
31+
*.yaml
32+
*.yml
33+
*.json
34+
*.gif
35+
frontend/*
36+
.DS_Store
37+
backend/.vscode/hummingbird.code-snippets
38+
backend/img/image.png
39+
LICENSE
40+
.licenseignore
41+
Makefile
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"version" : 1,
3+
"indentation" : {
4+
"spaces" : 4
5+
},
6+
"tabWidth" : 4,
7+
"fileScopedDeclarationPrivacy" : {
8+
"accessLevel" : "private"
9+
},
10+
"spacesAroundRangeFormationOperators" : false,
11+
"indentConditionalCompilationBlocks" : false,
12+
"indentSwitchCaseLabels" : false,
13+
"lineBreakAroundMultilineExpressionChainComponents" : false,
14+
"lineBreakBeforeControlFlowKeywords" : false,
15+
"lineBreakBeforeEachArgument" : true,
16+
"lineBreakBeforeEachGenericRequirement" : true,
17+
"lineLength" : 120,
18+
"maximumBlankLines" : 1,
19+
"respectsExistingLineBreaks" : true,
20+
"prioritizeKeepingFunctionOutputTogether" : true,
21+
"rules" : {
22+
"AllPublicDeclarationsHaveDocumentation" : false,
23+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
24+
"AlwaysUseLowerCamelCase" : false,
25+
"AmbiguousTrailingClosureOverload" : true,
26+
"BeginDocumentationCommentWithOneLineSummary" : false,
27+
"DoNotUseSemicolons" : true,
28+
"DontRepeatTypeInStaticProperties" : true,
29+
"FileScopedDeclarationPrivacy" : true,
30+
"FullyIndirectEnum" : true,
31+
"GroupNumericLiterals" : true,
32+
"IdentifiersMustBeASCII" : true,
33+
"NeverForceUnwrap" : false,
34+
"NeverUseForceTry" : false,
35+
"NeverUseImplicitlyUnwrappedOptionals" : false,
36+
"NoAccessLevelOnExtensionDeclaration" : true,
37+
"NoAssignmentInExpressions" : true,
38+
"NoBlockComments" : true,
39+
"NoCasesWithOnlyFallthrough" : true,
40+
"NoEmptyTrailingClosureParentheses" : true,
41+
"NoLabelsInCasePatterns" : true,
42+
"NoLeadingUnderscores" : false,
43+
"NoParensAroundConditions" : true,
44+
"NoVoidReturnOnFunctionSignature" : true,
45+
"OmitExplicitReturns" : true,
46+
"OneCasePerLine" : true,
47+
"OneVariableDeclarationPerLine" : true,
48+
"OnlyOneTrailingClosureArgument" : true,
49+
"OrderedImports" : true,
50+
"ReplaceForEachWithForLoop" : true,
51+
"ReturnVoidInsteadOfEmptyTuple" : true,
52+
"UseEarlyExits" : false,
53+
"UseExplicitNilCheckInConditions" : false,
54+
"UseLetInEveryBoundCaseVariable" : false,
55+
"UseShorthandTypeNames" : true,
56+
"UseSingleLinePropertyGetter" : false,
57+
"UseSynthesizedInitializer" : false,
58+
"UseTripleSlashForDocumentationComments" : true,
59+
"UseWhereClausesInForLoops" : false,
60+
"ValidateDocumentationComments" : false
61+
}
62+
}

swift-bedrock-library/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Makefile for library
2+
3+
format:
4+
swift format format -i ./Sources/*/*.swift
5+
swift format format -i ./Sources/*/*/*.swift
6+
swift format format -i ./Sources/*/*/*/*.swift
7+
swift format format -i ./Sources/*/*/*/*/*.swift
8+
swift format format -i ./Tests/*.swift
9+
swift format format -i ./Tests/*/*.swift
10+
swift format format -i ./Tests/*/*/*.swift
11+
12+
format-commit:
13+
make format
14+
git add .
15+
git commit -m'formatting'
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: "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: "Sources/BedrockTypes"
42+
),
43+
.testTarget(
44+
name: "BedrockServiceTests",
45+
dependencies: [
46+
.target(name: "BedrockService"),
47+
.target(name: "BedrockTypes"),
48+
],
49+
path: "Tests/BedrockServiceTests"
50+
),
51+
.testTarget(
52+
name: "BedrockTypesTests",
53+
dependencies: [
54+
.target(name: "BedrockTypes")
55+
],
56+
path: "Tests/BedrockTypesTests"
57+
),
58+
]
59+
)

0 commit comments

Comments
 (0)