diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d8b9716..3d85c64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,13 +10,13 @@ jobs: build: runs-on: macos-latest steps: - - uses: actions/checkout@v4 - - uses: swift-actions/setup-swift@v1 - with: - swift-version: "5.9" - - name: Check format - run: swift package plugin --allow-writing-to-package-directory swiftformat . - - name: Build Library - run: swift build --target FalClient --configuration release + - uses: actions/checkout@v4 + - uses: swift-actions/setup-swift@v1 + with: + swift-version: "5.9" + - name: Check format + run: swift package plugin --allow-writing-to-package-directory swiftformat . + - name: Build Library + run: swift build --target FalClient --configuration release # - name: Build Sample App # run: xcodebuild -project Sources/FalSampleApp/FalSampleApp.xcodeproj -scheme FalSampleApp diff --git a/.vscode/settings.json b/.vscode/settings.json index 9e26dfe..0967ef4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 35b5167..8b4fcfd 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the overall +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email address, +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities diff --git a/README.md b/README.md index a2dbd79..4f462f5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ## The fal.ai Swift Client -[![Swift](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffal-ai%2Fserverless-client-swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/fal-ai/serverless-client-swift) -[![](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffal-ai%2Fserverless-client-swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/fal-ai/serverless-client-swift) -![Build](https://img.shields.io/github/actions/workflow/status/fal-ai/serverless-client-swift/build.yml?style=flat-square) -![License](https://img.shields.io/github/license/fal-ai/serverless-client-swift?style=flat-square) +[![Swift](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffal-ai%2Ffal-swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/fal-ai/fal-swift) +[![](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ffal-ai%2Ffal-swift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/fal-ai/fal-swift) +![Build](https://img.shields.io/github/actions/workflow/status/fal-ai/fal-swift/build.yml?style=flat-square) +![License](https://img.shields.io/github/license/fal-ai/fal-swift?style=flat-square) ## About the Project @@ -23,6 +23,7 @@ This Swift client library is crafted as a lightweight layer atop Swift's network 1. Add `FalClient` as a dependency in your Swift Package Manager. 2. Set up the client instance: + ```swift import FalClient let fal = FalClient.withCredentials(.keyPair("FAL_KEY_ID:FAL_KEY_SECRET")) @@ -50,7 +51,7 @@ This Swift client library is crafted as a lightweight layer atop Swift's network - The result type in Swift will be a `[String: Any]` and the entries depend on the API output schema. - The Swift client also supports typed inputs and outputs through `Codable`. -## Real-time +## Real-time The client supports real-time model APIs. Checkout the [FalRealtimeSampleApp](./Sources/Samples/FalRealtimeSampleApp/) for more details. @@ -81,7 +82,7 @@ try connection.send(LcmInput( Check the `Sources/Samples` folder for a handful of sample applications using the `FalClient`. -Open them with `xed` to quickly start playing with +Open them with `xed` to quickly start playing with ```bash xed Sources/Samples/FalSampleApp @@ -89,7 +90,7 @@ xed Sources/Samples/FalSampleApp ## Roadmap -See the [open feature requests](https://github.com/fal-ai/serverless-client-swift/labels/enhancement) for a list of proposed features and join the discussion. +See the [open feature requests](https://github.com/fal-ai/fal-swift/labels/enhancement) for a list of proposed features and join the discussion. ## Contributing @@ -97,4 +98,4 @@ Contributions are what make the open source community such an amazing place to l ## License -Distributed under the MIT License. See [LICENSE](https://github.com/fal-ai/serverless-client-swift/blob/main/LICENSE) for more information. +Distributed under the MIT License. See [LICENSE](https://github.com/fal-ai/fal-swift/blob/main/LICENSE) for more information. diff --git a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json index eb87897..0afb3cf 100644 --- a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,11 +1,11 @@ { - "colors" : [ + "colors": [ { - "idiom" : "universal" + "idiom": "universal" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json index 532cd72..61590fa 100644 --- a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,63 +1,63 @@ { - "images" : [ + "images": [ { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" + "idiom": "universal", + "platform": "ios", + "size": "1024x1024" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "16x16" + "idiom": "mac", + "scale": "1x", + "size": "16x16" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "16x16" + "idiom": "mac", + "scale": "2x", + "size": "16x16" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "32x32" + "idiom": "mac", + "scale": "1x", + "size": "32x32" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "32x32" + "idiom": "mac", + "scale": "2x", + "size": "32x32" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "128x128" + "idiom": "mac", + "scale": "1x", + "size": "128x128" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "128x128" + "idiom": "mac", + "scale": "2x", + "size": "128x128" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "256x256" + "idiom": "mac", + "scale": "1x", + "size": "256x256" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "256x256" + "idiom": "mac", + "scale": "2x", + "size": "256x256" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "512x512" + "idiom": "mac", + "scale": "1x", + "size": "512x512" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "512x512" + "idiom": "mac", + "scale": "2x", + "size": "512x512" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/Contents.json b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/Contents.json +++ b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Preview Content/Preview Assets.xcassets/Contents.json b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Preview Content/Preview Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Preview Content/Preview Assets.xcassets/Contents.json +++ b/Sources/Samples/FalCameraSampleApp/FalCameraSampleApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json index eb87897..0afb3cf 100644 --- a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,11 +1,11 @@ { - "colors" : [ + "colors": [ { - "idiom" : "universal" + "idiom": "universal" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json index 532cd72..61590fa 100644 --- a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,63 +1,63 @@ { - "images" : [ + "images": [ { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" + "idiom": "universal", + "platform": "ios", + "size": "1024x1024" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "16x16" + "idiom": "mac", + "scale": "1x", + "size": "16x16" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "16x16" + "idiom": "mac", + "scale": "2x", + "size": "16x16" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "32x32" + "idiom": "mac", + "scale": "1x", + "size": "32x32" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "32x32" + "idiom": "mac", + "scale": "2x", + "size": "32x32" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "128x128" + "idiom": "mac", + "scale": "1x", + "size": "128x128" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "128x128" + "idiom": "mac", + "scale": "2x", + "size": "128x128" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "256x256" + "idiom": "mac", + "scale": "1x", + "size": "256x256" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "256x256" + "idiom": "mac", + "scale": "2x", + "size": "256x256" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "512x512" + "idiom": "mac", + "scale": "1x", + "size": "512x512" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "512x512" + "idiom": "mac", + "scale": "2x", + "size": "512x512" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/Contents.json b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/Contents.json +++ b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Preview Content/Preview Assets.xcassets/Contents.json b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Preview Content/Preview Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Preview Content/Preview Assets.xcassets/Contents.json +++ b/Sources/Samples/FalRealtimeSampleApp/FalRealtimeSampleApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json index eb87897..0afb3cf 100644 --- a/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json +++ b/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,11 +1,11 @@ { - "colors" : [ + "colors": [ { - "idiom" : "universal" + "idiom": "universal" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json index 532cd72..61590fa 100644 --- a/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,63 +1,63 @@ { - "images" : [ + "images": [ { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" + "idiom": "universal", + "platform": "ios", + "size": "1024x1024" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "16x16" + "idiom": "mac", + "scale": "1x", + "size": "16x16" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "16x16" + "idiom": "mac", + "scale": "2x", + "size": "16x16" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "32x32" + "idiom": "mac", + "scale": "1x", + "size": "32x32" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "32x32" + "idiom": "mac", + "scale": "2x", + "size": "32x32" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "128x128" + "idiom": "mac", + "scale": "1x", + "size": "128x128" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "128x128" + "idiom": "mac", + "scale": "2x", + "size": "128x128" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "256x256" + "idiom": "mac", + "scale": "1x", + "size": "256x256" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "256x256" + "idiom": "mac", + "scale": "2x", + "size": "256x256" }, { - "idiom" : "mac", - "scale" : "1x", - "size" : "512x512" + "idiom": "mac", + "scale": "1x", + "size": "512x512" }, { - "idiom" : "mac", - "scale" : "2x", - "size" : "512x512" + "idiom": "mac", + "scale": "2x", + "size": "512x512" } ], - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/Contents.json b/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/Contents.json +++ b/Sources/Samples/FalSampleApp/FalSampleApp/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } } diff --git a/Sources/Samples/FalSampleApp/FalSampleApp/Preview Content/Preview Assets.xcassets/Contents.json b/Sources/Samples/FalSampleApp/FalSampleApp/Preview Content/Preview Assets.xcassets/Contents.json index 73c0059..74d6a72 100644 --- a/Sources/Samples/FalSampleApp/FalSampleApp/Preview Content/Preview Assets.xcassets/Contents.json +++ b/Sources/Samples/FalSampleApp/FalSampleApp/Preview Content/Preview Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { - "info" : { - "author" : "xcode", - "version" : 1 + "info": { + "author": "xcode", + "version": 1 } }