@capgo/capacitor-llm 7.2.4 → 7.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Package.swift CHANGED
@@ -1,16 +1,6 @@
1
1
  // swift-tools-version: 5.9
2
2
  import PackageDescription
3
3
 
4
- // IMPORTANT: This Package.swift is for Swift Package Manager only.
5
- // If you use CocoaPods, the CapgoCapacitorLlm.podspec will be used instead,
6
- // which includes MediaPipe dependencies. Both approaches are fully supported:
7
- //
8
- // - SPM: Provides Apple Intelligence support (iOS 18.2+)
9
- // - CocoaPods: Provides both Apple Intelligence AND MediaPipe custom models
10
- //
11
- // The Swift code uses conditional compilation (#if COCOAPODS) to detect
12
- // which dependency manager is being used and enables appropriate features.
13
-
14
4
  let package = Package(
15
5
  name: "CapgoLLM",
16
6
  platforms: [.iOS(.v14)],
@@ -21,10 +11,6 @@ let package = Package(
21
11
  ],
22
12
  dependencies: [
23
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
24
- // Note: SwiftTasksGenAI contains unsafe build flags and cannot be used with SPM
25
- // For MediaPipe GenAI support, use CocoaPods instead (see CapgoCapacitorLlm.podspec)
26
- // See: https://github.com/paescebu/SwiftTasksGenAI
27
- // .package(url: "https://github.com/paescebu/SwiftTasksGenAI.git", from: "0.10.0")
28
14
  ],
29
15
  targets: [
30
16
  .target(
@@ -32,8 +18,6 @@ let package = Package(
32
18
  dependencies: [
33
19
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
34
20
  .product(name: "Cordova", package: "capacitor-swift-pm")
35
- // SwiftTasksGenAI cannot be added due to unsafe build flags
36
- // Use CocoaPods for MediaPipe GenAI support
37
21
  ],
38
22
  path: "ios/Sources/LLMPlugin"),
39
23
  .testTarget(
package/README.md CHANGED
@@ -60,7 +60,19 @@ end
60
60
  ```
61
61
 
62
62
  **Using Swift Package Manager:**
63
- MediaPipe GenAI is currently only available via CocoaPods. While community packages like [SwiftTasksGenAI](https://github.com/paescebu/SwiftTasksGenAI) exist, they contain unsafe build flags that prevent their use in standard SPM builds. For custom models on iOS, CocoaPods is required. However, **Apple Intelligence works with SPM** and is the recommended approach for iOS.
63
+
64
+ MediaPipe GenAI does not officially support SPM yet (see [MediaPipe issue #5464](https://github.com/google-ai-edge/mediapipe/issues/5464)). However, you can use the community package [SwiftTasksGenAI](https://github.com/paescebu/SwiftTasksGenAI) by adding it manually in Xcode:
65
+
66
+ **To add MediaPipe GenAI via SPM:**
67
+ 1. Open your app project in Xcode
68
+ 2. Go to **File > Add Package Dependencies...**
69
+ 3. Enter the URL: `https://github.com/paescebu/SwiftTasksGenAI.git`
70
+ 4. Select your desired version (e.g., 0.10.24)
71
+ 5. Add the `SwiftTasksGenAI` product to your app target
72
+
73
+ **Note:** SwiftTasksGenAI uses unsafe build flags, which means it cannot be added directly in Package.swift files, but works fine when added through Xcode's UI. This is the same approach used by SwiftTasksVision.
74
+
75
+ **Alternatively:** Use CocoaPods for a more traditional setup, or use Apple Intelligence (iOS 18.2+) which works with both SPM and CocoaPods.
64
76
 
65
77
  ## Adding a Model to Your App
66
78
 
@@ -9,7 +9,7 @@ import com.getcapacitor.annotation.CapacitorPlugin;
9
9
  @CapacitorPlugin(name = "CapgoLLM")
10
10
  public class LLMPlugin extends Plugin {
11
11
 
12
- private final String PLUGIN_VERSION = "7.2.4";
12
+ private final String PLUGIN_VERSION = "7.2.6";
13
13
 
14
14
  private LLM llm;
15
15
 
@@ -16,7 +16,7 @@ import MediaPipeTasksGenAI
16
16
 
17
17
  @objc(LLMPlugin)
18
18
  public class LLMPlugin: CAPPlugin, CAPBridgedPlugin {
19
- private let PLUGIN_VERSION: String = "7.2.4"
19
+ private let PLUGIN_VERSION: String = "7.2.6"
20
20
  public let identifier = "LLMPlugin"
21
21
  public let jsName = "CapgoLLM"
22
22
  public var pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-llm",
3
- "version": "7.2.4",
3
+ "version": "7.2.6",
4
4
  "description": "Adds support for LLM locally runned for Capacitor",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",