@umituz/react-native-ai-pruna-provider 1.0.22 → 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.22",
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",
@@ -57,11 +57,17 @@ export async function uploadFileToStorage(
57
57
  // Fetch the temp file to get a Blob
58
58
  const response = await fetch(tempUri);
59
59
  const blob = await response.blob();
60
- generationLogCollector.log(sessionId, TAG, `Temp file created (${blob.size} bytes), uploading to Pruna...`);
61
60
 
62
- // Create FormData with the blob
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}...`);
67
+
68
+ // Create FormData with the blob AND proper filename with extension
63
69
  const formData = new FormData();
64
- formData.append('content', blob, 'upload');
70
+ formData.append('content', blob, filename);
65
71
 
66
72
  const startTime = Date.now();
67
73