expo-ai-kit 0.11.0 → 0.11.1

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.
@@ -131,16 +131,10 @@ class ExpoAiKitModule : Module() {
131
131
  // ==================================================================
132
132
  // Embeddings
133
133
  // ==================================================================
134
- // iOS-only for now (Apple NLContextualEmbedding). The JS layer guards the
135
- // platform and throws before reaching native, so this is a defensive stub
136
- // that honors the same "CODE::reason" error contract. Android support via
137
- // MediaPipe Text Embedder is planned.
138
- AsyncFunction("embed") { _: List<String> ->
139
- throw RuntimeException(
140
- "DEVICE_NOT_SUPPORTED::On-device embeddings are iOS-only for now " +
141
- "(Apple NLContextualEmbedding); Android support via MediaPipe is planned"
142
- )
143
- }
134
+ // No native embed() on Android: embeddings are iOS-only for now (Apple
135
+ // NLContextualEmbedding). src/index.ts#embed guards the platform in JS and
136
+ // throws DEVICE_NOT_SUPPORTED before reaching native, so there is nothing to
137
+ // register here. Android support via MediaPipe Text Embedder is planned.
144
138
 
145
139
  // ==================================================================
146
140
  // Model discovery
@@ -245,7 +245,7 @@ public class ExpoAiKitModule: Module {
245
245
  if !model.hasAvailableAssets {
246
246
  try await withCheckedThrowingContinuation {
247
247
  (cont: CheckedContinuation<Void, Error>) in
248
- model.requestEmbeddingAssets { _, error in
248
+ model.requestAssets{ _, error in
249
249
  if let error = error {
250
250
  cont.resume(throwing: error)
251
251
  } else {
@@ -254,10 +254,8 @@ public class ExpoAiKitModule: Module {
254
254
  }
255
255
  }
256
256
  }
257
-
258
- if !model.isLoaded {
259
- try model.load()
260
- }
257
+
258
+ try model.load()
261
259
 
262
260
  let dimension = model.dimension
263
261
  var embeddings: [[Double]] = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-ai-kit",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "On-device AI for Expo — run Gemma 4, Apple Foundation Models & ML Kit locally: streaming, structured output, tool calling, embeddings & RAG, Vercel AI SDK provider, zero API keys",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",