@umituz/react-native-ai-fal-provider 1.0.84 → 1.0.85
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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-ai-fal-provider",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.85",
|
|
4
4
|
"description": "FAL AI provider for React Native - implements IAIProvider interface for unified AI generation",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -18,10 +18,7 @@ import type {
|
|
|
18
18
|
ProviderCapabilities,
|
|
19
19
|
} from "@umituz/react-native-ai-generation-content";
|
|
20
20
|
import type { FalQueueStatus } from "../../domain/entities/fal.types";
|
|
21
|
-
import type {
|
|
22
|
-
CostTrackerConfig,
|
|
23
|
-
GenerationCost,
|
|
24
|
-
} from "../../domain/entities/cost-tracking.types";
|
|
21
|
+
import type { CostTrackerConfig } from "../../domain/entities/cost-tracking.types";
|
|
25
22
|
import { DEFAULT_FAL_CONFIG, FAL_CAPABILITIES } from "./fal-provider.constants";
|
|
26
23
|
import { mapFalStatusToJobStatus } from "./fal-status-mapper";
|
|
27
24
|
import {
|
|
@@ -163,27 +160,23 @@ export class FalProvider implements IAIProvider {
|
|
|
163
160
|
|
|
164
161
|
const operationId = this.costTracker?.startOperation(model, "subscribe");
|
|
165
162
|
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
const { result, requestId } = await handleFalSubscription<T>(
|
|
164
|
+
model,
|
|
165
|
+
input,
|
|
166
|
+
options,
|
|
167
|
+
this.currentAbortController.signal,
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
if (operationId && this.costTracker) {
|
|
171
|
+
this.costTracker.completeOperation(
|
|
172
|
+
operationId,
|
|
168
173
|
model,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
this.currentAbortController.signal,
|
|
174
|
+
"subscribe",
|
|
175
|
+
requestId ?? undefined,
|
|
172
176
|
);
|
|
173
|
-
|
|
174
|
-
if (operationId && this.costTracker) {
|
|
175
|
-
this.costTracker.completeOperation(
|
|
176
|
-
operationId,
|
|
177
|
-
model,
|
|
178
|
-
"subscribe",
|
|
179
|
-
requestId ?? undefined,
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return result;
|
|
184
|
-
} catch (error) {
|
|
185
|
-
throw error;
|
|
186
177
|
}
|
|
178
|
+
|
|
179
|
+
return result;
|
|
187
180
|
}
|
|
188
181
|
|
|
189
182
|
async run<T = unknown>(
|
|
@@ -195,17 +188,13 @@ export class FalProvider implements IAIProvider {
|
|
|
195
188
|
|
|
196
189
|
const operationId = this.costTracker?.startOperation(model, "run");
|
|
197
190
|
|
|
198
|
-
|
|
199
|
-
const result = await handleFalRun<T>(model, input, options);
|
|
191
|
+
const result = await handleFalRun<T>(model, input, options);
|
|
200
192
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return result;
|
|
206
|
-
} catch (error) {
|
|
207
|
-
throw error;
|
|
193
|
+
if (operationId && this.costTracker) {
|
|
194
|
+
this.costTracker.completeOperation(operationId, model, "run");
|
|
208
195
|
}
|
|
196
|
+
|
|
197
|
+
return result;
|
|
209
198
|
}
|
|
210
199
|
|
|
211
200
|
reset(): void {
|