@umituz/react-native-ai-pruna-provider 1.0.32 → 1.0.34

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-pruna-provider",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Pruna AI provider for React Native - implements IAIProvider interface for unified AI generation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -119,7 +119,7 @@ async function buildImageEditInput(
119
119
  }
120
120
  }
121
121
 
122
- generationLogCollector.log(sessionId, TAG, `p-image-edit: all ${imageUrls.length} image(s) uploaded successfully`);
122
+ generationLogCollector.log(sessionId, TAG, `p-image-edit: image upload completed, using first image`);
123
123
 
124
124
  // __DEV__ log final payload
125
125
  if (typeof __DEV__ !== 'undefined' && __DEV__) {
@@ -127,12 +127,13 @@ async function buildImageEditInput(
127
127
  imageCount: imageUrls.length,
128
128
  promptLength: prompt.length,
129
129
  aspectRatio,
130
- imageUrls: imageUrls.map(u => u.substring(0, 60) + '...'),
130
+ imageUrl: imageUrls[0].substring(0, 60) + '...',
131
131
  });
132
132
  }
133
133
 
134
+ // Pruna API expects singular 'image' (not 'images' array)
134
135
  const payload: Record<string, unknown> = {
135
- images: imageUrls,
136
+ image: imageUrls[0], // Use first uploaded image
136
137
  prompt,
137
138
  aspect_ratio: aspectRatio,
138
139
  };
@@ -67,6 +67,17 @@ async function singleSubscribeAttempt<T = unknown>(
67
67
  const response = await submitPrediction(model, modelInput, apiKey, sessionId, signal);
68
68
  let uri = extractUri(response);
69
69
 
70
+ // __DEV__ log extracted URI
71
+ if (typeof __DEV__ !== 'undefined' && __DEV__) {
72
+ console.log(`[DEV] [${TAG}] Extracted URI:`, {
73
+ hasUri: !!uri,
74
+ uri: uri?.substring(0, 100) + '...',
75
+ uriFull: uri,
76
+ responseKeys: Object.keys(response),
77
+ status: response.status,
78
+ });
79
+ }
80
+
70
81
  // If no immediate result, poll for async result
71
82
  if (!uri && (response.get_url || response.status_url)) {
72
83
  const pollUrl = (response.get_url || response.status_url)!;
@@ -91,7 +102,18 @@ async function singleSubscribeAttempt<T = unknown>(
91
102
  throw new Error("Empty result from Pruna AI. Please try again.");
92
103
  }
93
104
 
94
- return resolveUri(uri);
105
+ const resolvedUri = resolveUri(uri);
106
+
107
+ // __DEV__ log final result
108
+ if (typeof __DEV__ !== 'undefined' && __DEV__) {
109
+ console.log(`[DEV] [${TAG}] Returning URI:`, {
110
+ originalUri: uri,
111
+ resolvedUri,
112
+ resolvedUriPrefix: resolvedUri.substring(0, 100) + '...',
113
+ });
114
+ }
115
+
116
+ return resolvedUri;
95
117
  })();
96
118
 
97
119
  const timeoutPromise = new Promise<never>((_, reject) => {