I am getting this error when using GPT-4V with openai on node.js:
Overload 1 of 3, '(body: ChatCompletionCreateParamsNonStreaming, options?: RequestOptions<Record<string, unknown> | Readable> | undefined): APIPromise<...>', gave the following error.
Type 'string' has no properties in common with type 'ImageURL'.
Overload 2 of 3, '(body: ChatCompletionCreateParamsStreaming, options?: RequestOptions<Record<string, unknown> | Readable> | undefined): APIPromise<...>', gave the following error.
Type 'string' has no properties in common with type 'ImageURL'.
Overload 3 of 3, '(body: ChatCompletionCreateParamsBase, options?: RequestOptions<Record<string, unknown> | Readable> | undefined): APIPromise<...>', gave the following error.
Type 'string' has no properties in common with type 'ImageURL'.
This is my code:
const response = await openai.chat.completions.create({
model: "gpt-4-vision-preview",
max_tokens: 4096,
temperature: 0,
messages: [
{
role: "system",
content: "..."
},
{
role: "user",
content: [
{ type: "text", text: "..." },
{
type: "image_url",
image_url: `${url}`,
},
],
},
],
});