call-ai 0.10.0 → 0.10.1
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/dist/image.js +4 -5
- package/package.json +1 -1
package/dist/image.js
CHANGED
|
@@ -11,7 +11,7 @@ const PACKAGE_VERSION = require("../package.json").version;
|
|
|
11
11
|
* @returns A Promise that resolves to the image response containing base64 encoded image data
|
|
12
12
|
*/
|
|
13
13
|
async function imageGen(prompt, options = {}) {
|
|
14
|
-
const { model = "gpt-image-1", apiKey = "VIBES_DIY", debug = false, } = options;
|
|
14
|
+
const { model = "gpt-image-1", apiKey = "VIBES_DIY", debug = false, size = "1024x1024", } = options;
|
|
15
15
|
if (debug) {
|
|
16
16
|
console.log(`[imageGen:${PACKAGE_VERSION}] Generating image with prompt: ${prompt.substring(0, 50)}...`);
|
|
17
17
|
console.log(`[imageGen:${PACKAGE_VERSION}] Using model: ${model}`);
|
|
@@ -39,7 +39,7 @@ async function imageGen(prompt, options = {}) {
|
|
|
39
39
|
body: JSON.stringify({
|
|
40
40
|
model,
|
|
41
41
|
prompt,
|
|
42
|
-
|
|
42
|
+
size,
|
|
43
43
|
...(options.quality && { quality: options.quality }),
|
|
44
44
|
...(options.style && { style: options.style }),
|
|
45
45
|
}),
|
|
@@ -60,9 +60,8 @@ async function imageGen(prompt, options = {}) {
|
|
|
60
60
|
options.images.forEach((image, index) => {
|
|
61
61
|
formData.append(`image_${index}`, image);
|
|
62
62
|
});
|
|
63
|
-
// Add
|
|
64
|
-
|
|
65
|
-
formData.append("size", options.size);
|
|
63
|
+
// Add parameters
|
|
64
|
+
formData.append("size", size);
|
|
66
65
|
if (options.quality)
|
|
67
66
|
formData.append("quality", options.quality);
|
|
68
67
|
if (options.style)
|