@umituz/react-native-ai-pruna-provider 1.0.12 → 1.0.13
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.
|
|
3
|
+
"version": "1.0.13",
|
|
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",
|
|
@@ -68,7 +68,8 @@ function buildImageEditInput(
|
|
|
68
68
|
input: Record<string, unknown>,
|
|
69
69
|
sessionId: string,
|
|
70
70
|
): Record<string, unknown> {
|
|
71
|
-
// p-image-edit expects images array (base64
|
|
71
|
+
// p-image-edit expects images array (base64 with data URI prefix or HTTPS URLs)
|
|
72
|
+
// Base64 format: data:image/jpeg;base64,{base64_string}
|
|
72
73
|
let images: string[];
|
|
73
74
|
|
|
74
75
|
if (Array.isArray(input.images)) {
|
|
@@ -76,13 +77,13 @@ function buildImageEditInput(
|
|
|
76
77
|
if (validImages.length === 0) {
|
|
77
78
|
throw new Error("Image array is empty or contains no valid strings for p-image-edit.");
|
|
78
79
|
}
|
|
79
|
-
images = validImages
|
|
80
|
+
images = validImages; // Keep data URI prefix for base64 images
|
|
80
81
|
} else if (typeof input.image === 'string') {
|
|
81
|
-
images = [
|
|
82
|
+
images = [input.image as string]; // Keep data URI prefix for base64 images
|
|
82
83
|
} else if (typeof input.image_url === 'string') {
|
|
83
|
-
images = [
|
|
84
|
+
images = [input.image_url as string]; // Keep data URI prefix for base64 images
|
|
84
85
|
} else if (Array.isArray(input.image_urls)) {
|
|
85
|
-
images =
|
|
86
|
+
images = input.image_urls as string[]; // Keep data URI prefix for base64 images
|
|
86
87
|
} else {
|
|
87
88
|
throw new Error("Image is required for p-image-edit. Provide 'image', 'images', 'image_url', or 'image_urls'.");
|
|
88
89
|
}
|