import fs from "fs";
import OpenAI from "openai";
export default async ({apiKey, image_file}: NodeInputs,{ logging }: NodeScriptOptions) : NodeOutput => {
const openai = new OpenAI({apiKey});
const file = await openai.files.create({
file: fs.createReadStream(image_file),
purpose: "assistants",
});
console.log(file);
}
{I tried changing image_file type to string, any, and object, same error.
"error": {
"code": "ERR_INVALID_ARG_VALUE"
},
"label": "API Call",
"message": "The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received <Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 02 28 00 00 01 6d 08 06 00 00 00 2d 70 91 c7 00 00 00 01 73 52 47 ..."
}
{
"error": {
"code": "ERR_INVALID_ARG_TYPE"
},
"label": "API Call",
"message": "The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of Object"
}
{
"error": {
"code": "ERR_INVALID_ARG_TYPE"
},
"label": "API Call",
"message": "The "path" argument must be of type string or an instance of Buffer or URL. Received undefined"
}


