@umituz/react-native-ai-generation-content 1.26.0 → 1.26.2

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.26.0",
3
+ "version": "1.26.2",
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",
@@ -25,6 +25,8 @@ export interface CoupleFutureInput {
25
25
  }
26
26
 
27
27
  export interface CoupleFutureConfig {
28
+ /** REQUIRED: AI model ID from app config */
29
+ model: string;
28
30
  timeoutMs?: number;
29
31
  aspectRatio?: NanoBananaAspectRatio;
30
32
  outputFormat?: NanoBananaOutputFormat;
@@ -16,8 +16,15 @@ const formatBase64 = (base64: string): string => {
16
16
 
17
17
  export async function executeCoupleFuture(
18
18
  input: CoupleFutureInput,
19
- config?: CoupleFutureConfig,
19
+ config: CoupleFutureConfig,
20
20
  ): Promise<CoupleFutureResult> {
21
+ if (!config || !config.model) {
22
+ return {
23
+ success: false,
24
+ error: "Model is required. Please provide model from app's generation config.",
25
+ };
26
+ }
27
+
21
28
  if (typeof __DEV__ !== "undefined" && __DEV__) {
22
29
  console.log("[Executor] ========== COUPLE FUTURE START ==========");
23
30
  console.log("[Executor] Input received:", {
@@ -29,6 +36,7 @@ export async function executeCoupleFuture(
29
36
  prompt: input.prompt?.slice(0, 300),
30
37
  });
31
38
  console.log("[Executor] Config:", {
39
+ model: config.model,
32
40
  hasOnProgress: !!config?.onProgress,
33
41
  timeoutMs: config?.timeoutMs,
34
42
  aspectRatio: config?.aspectRatio,
@@ -99,7 +107,7 @@ export async function executeCoupleFuture(
99
107
 
100
108
  if (typeof __DEV__ !== "undefined" && __DEV__) {
101
109
  console.log("[Executor] 📤 FAL AI Request:");
102
- console.log("[Executor] Model:", COUPLE_FUTURE_DEFAULTS.model);
110
+ console.log("[Executor] Model:", config.model);
103
111
  console.log("[Executor] Prompt:", enhancedPrompt.slice(0, 400));
104
112
  console.log("[Executor] Aspect ratio:", modelInput.aspect_ratio);
105
113
  console.log("[Executor] Output format:", modelInput.output_format);
@@ -110,7 +118,7 @@ export async function executeCoupleFuture(
110
118
  console.log("[Executor] 📡 Calling provider.subscribe()...");
111
119
  }
112
120
 
113
- const result = await provider.subscribe(COUPLE_FUTURE_DEFAULTS.model, modelInput, {
121
+ const result = await provider.subscribe(config.model, modelInput, {
114
122
  timeoutMs: timeoutMs ?? COUPLE_FUTURE_DEFAULTS.timeoutMs,
115
123
  onQueueUpdate: (status) => {
116
124
  if (status.status === lastStatus) return;
@@ -14,13 +14,13 @@ declare const __DEV__: boolean;
14
14
 
15
15
  export interface GenerationModels {
16
16
  /** Image generation with face identity preservation (couple photos) */
17
- readonly imageCoupleMultiRef: string;
17
+ readonly imageCoupleMultiRef?: string;
18
18
  /** Text-to-image generation */
19
- readonly imageTextToImage: string;
19
+ readonly imageTextToImage?: string;
20
20
  /** Image-to-video generation */
21
- readonly imageToVideo: string;
21
+ readonly imageToVideo?: string;
22
22
  /** Text-to-video generation */
23
- readonly textToVideo: string;
23
+ readonly textToVideo?: string;
24
24
  /** AI Kiss video */
25
25
  readonly aiKiss?: string;
26
26
  /** AI Hug video */
@@ -62,19 +62,30 @@ export const GenerationConfigProvider: React.FC<GenerationConfigProviderProps> =
62
62
  models,
63
63
  }) => {
64
64
  if (typeof __DEV__ !== "undefined" && __DEV__) {
65
+ const configuredModels = Object.entries(models)
66
+ .filter(([, value]) => !!value)
67
+ .map(([key]) => key);
68
+
65
69
  console.log("[GenerationConfigProvider] Initialized with models:", {
66
- imageCoupleMultiRef: models.imageCoupleMultiRef,
67
- imageTextToImage: models.imageTextToImage,
68
- imageToVideo: models.imageToVideo,
69
- textToVideo: models.textToVideo,
70
+ configured: configuredModels,
71
+ imageCoupleMultiRef: models.imageCoupleMultiRef || "not configured",
72
+ imageTextToImage: models.imageTextToImage || "not configured",
73
+ imageToVideo: models.imageToVideo || "not configured",
74
+ textToVideo: models.textToVideo || "not configured",
70
75
  });
71
76
  }
72
77
 
73
78
  const getModel = (featureType: keyof GenerationModels): string => {
74
79
  const model = models[featureType];
75
80
  if (!model) {
81
+ const availableModels = Object.keys(models).filter(
82
+ (key) => models[key as keyof GenerationModels]
83
+ );
84
+
76
85
  throw new Error(
77
- `Model not configured for feature: ${featureType}. Please configure in app's GenerationConfigProvider.`
86
+ `Model not configured for feature: ${featureType}.\n\n` +
87
+ `This app only supports: ${availableModels.join(", ") || "none"}.\n` +
88
+ `Please configure '${featureType}' in your GenerationConfigProvider if you need it.`
78
89
  );
79
90
  }
80
91
  return model;