@umituz/react-native-ai-pruna-provider 1.0.23 → 1.0.24

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.23",
3
+ "version": "1.0.24",
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",
@@ -46,13 +46,6 @@ export async function uploadFileToStorage(
46
46
 
47
47
  generationLogCollector.log(sessionId, TAG, 'Uploading file to Pruna storage...');
48
48
 
49
- // Detect MIME type BEFORE creating temp file (needed for filename)
50
- const mimeType = detectMimeType(base64Data);
51
- const extension = getExtensionForMime(mimeType);
52
- const filename = `upload.${extension}`;
53
-
54
- generationLogCollector.log(sessionId, TAG, `Detected MIME type: ${mimeType}, extension: ${extension}`);
55
-
56
49
  // Use design system filesystem to create temp file (React Native compatible)
57
50
  const tempUri = await base64ToTempFile(base64Data);
58
51
 
@@ -64,7 +57,13 @@ export async function uploadFileToStorage(
64
57
  // Fetch the temp file to get a Blob
65
58
  const response = await fetch(tempUri);
66
59
  const blob = await response.blob();
67
- generationLogCollector.log(sessionId, TAG, `Temp file created (${blob.size} bytes, type: ${blob.type || mimeType}), uploading to Pruna as ${filename}...`);
60
+
61
+ // Use blob's MIME type (more accurate than base64 detection)
62
+ const actualMimeType = blob.type || 'image/jpeg';
63
+ const extension = getExtensionForMime(actualMimeType);
64
+ const filename = `upload.${extension}`;
65
+
66
+ generationLogCollector.log(sessionId, TAG, `Temp file created (${blob.size} bytes, type: ${actualMimeType}), uploading to Pruna as ${filename}...`);
68
67
 
69
68
  // Create FormData with the blob AND proper filename with extension
70
69
  const formData = new FormData();