You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is this?"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,..."
}
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "This image shows a dish composed of various cooked vegetables and what appears to be pieces of meat. The vegetables include broccoli, carrots, green beans, corn, and possibly some others. The meat is seasoned and the whole dish seems to be baked or roasted. It looks like a hearty and colorful meal!"
}
]
}
],
temperature: 1,
max_tokens: 256,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
});
Code snippets
No response
OS
macOS
Node version
v20.13.1
Library version
4.47.1
The text was updated successfully, but these errors were encountered:
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
When we use OpenAI.chat.completions.create and define messages as in the example below. There is an error from TS "No overload matches this call."
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is this?"
}
}]
To Reproduce
import OpenAI from "openai";
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What is this?"
},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,..."
}
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "This image shows a dish composed of various cooked vegetables and what appears to be pieces of meat. The vegetables include broccoli, carrots, green beans, corn, and possibly some others. The meat is seasoned and the whole dish seems to be baked or roasted. It looks like a hearty and colorful meal!"
}
]
}
],
temperature: 1,
max_tokens: 256,
top_p: 1,
frequency_penalty: 0,
presence_penalty: 0,
});
Code snippets
No response
OS
macOS
Node version
v20.13.1
Library version
4.47.1
The text was updated successfully, but these errors were encountered: