@umituz/react-native-ai-generation-content 1.25.23 → 1.25.25
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-generation-content",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.25",
|
|
4
4
|
"description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -40,8 +40,18 @@ type WizardGenerationResult = { imageUrl: string } | { videoUrl: string };
|
|
|
40
40
|
|
|
41
41
|
async function executeImageGeneration(
|
|
42
42
|
input: ImageGenerationInput,
|
|
43
|
+
model: string,
|
|
43
44
|
onProgress?: (progress: number) => void,
|
|
44
45
|
): Promise<{ success: boolean; imageUrl?: string; error?: string }> {
|
|
46
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
47
|
+
console.log("[WizardStrategy] executeImageGeneration ENTRY", {
|
|
48
|
+
receivedModel: model,
|
|
49
|
+
hasPartnerA: !!input.partnerABase64,
|
|
50
|
+
hasPartnerB: !!input.partnerBBase64,
|
|
51
|
+
promptLength: input.prompt.length,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
45
55
|
const { providerRegistry } = await import("../../../../infrastructure/services/provider-registry.service");
|
|
46
56
|
|
|
47
57
|
const provider = providerRegistry.getActiveProvider();
|
|
@@ -78,11 +88,16 @@ async function executeImageGeneration(
|
|
|
78
88
|
};
|
|
79
89
|
|
|
80
90
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
81
|
-
console.log("[WizardStrategy]
|
|
91
|
+
console.log("[WizardStrategy] ABOUT TO CALL provider.subscribe", {
|
|
92
|
+
model,
|
|
93
|
+
modelType: typeof model,
|
|
94
|
+
modelLength: model?.length,
|
|
95
|
+
imageUrlsCount: imageUrls.length,
|
|
96
|
+
});
|
|
82
97
|
}
|
|
83
98
|
|
|
84
99
|
let lastStatus = "";
|
|
85
|
-
const result = await provider.subscribe(
|
|
100
|
+
const result = await provider.subscribe(model, modelInput, {
|
|
86
101
|
timeoutMs: 120000,
|
|
87
102
|
onQueueUpdate: (status) => {
|
|
88
103
|
if (status.status === lastStatus) return;
|
|
@@ -237,14 +252,25 @@ export const createWizardStrategy = (
|
|
|
237
252
|
const outputType = scenario.outputType || "video";
|
|
238
253
|
const videoFeatureType = getVideoFeatureType(scenario.id);
|
|
239
254
|
|
|
255
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
256
|
+
console.log("[WizardStrategy] createWizardStrategy called", {
|
|
257
|
+
scenarioId: scenario.id,
|
|
258
|
+
scenarioModel: scenario.model,
|
|
259
|
+
outputType,
|
|
260
|
+
hasModel: !!scenario.model,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
240
264
|
let lastInputRef: WizardGenerationInput | null = null;
|
|
241
265
|
|
|
242
266
|
return {
|
|
243
267
|
execute: async (input, onProgress) => {
|
|
244
268
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
245
|
-
console.log("[WizardStrategy]
|
|
269
|
+
console.log("[WizardStrategy] execute() called", {
|
|
246
270
|
scenarioId: scenario.id,
|
|
247
271
|
outputType,
|
|
272
|
+
scenarioModel: scenario.model,
|
|
273
|
+
hasModel: !!scenario.model,
|
|
248
274
|
});
|
|
249
275
|
}
|
|
250
276
|
|
|
@@ -252,8 +278,20 @@ export const createWizardStrategy = (
|
|
|
252
278
|
|
|
253
279
|
// Execute based on output type
|
|
254
280
|
if (outputType === "image") {
|
|
281
|
+
// Validate model is provided by app
|
|
282
|
+
if (!scenario.model) {
|
|
283
|
+
throw new Error("Model is required for image generation. Please configure model in app generation.config.ts");
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
287
|
+
console.log("[WizardStrategy] About to call executeImageGeneration", {
|
|
288
|
+
model: scenario.model,
|
|
289
|
+
scenarioId: scenario.id,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
255
293
|
const imageInput = input as ImageGenerationInput;
|
|
256
|
-
const result = await executeImageGeneration(imageInput, onProgress);
|
|
294
|
+
const result = await executeImageGeneration(imageInput, scenario.model, onProgress);
|
|
257
295
|
|
|
258
296
|
if (!result.success || !result.imageUrl) {
|
|
259
297
|
throw new Error(result.error || "Image generation failed");
|
|
@@ -20,6 +20,7 @@ export interface WizardScenarioData {
|
|
|
20
20
|
readonly id: string;
|
|
21
21
|
readonly aiPrompt: string;
|
|
22
22
|
readonly outputType?: WizardOutputType;
|
|
23
|
+
readonly model?: string; // AI model from app config
|
|
23
24
|
readonly title?: string;
|
|
24
25
|
readonly description?: string;
|
|
25
26
|
[key: string]: unknown;
|