Hello, I’m having difficulties with switching from text-davinci-003 to gpt-3.5-turbo-1106. Here’s my code:
async function handleSubmit() {
if (AIInput) {
const prompt = `{prompt removed to make code shorter}`
const response = await openai.chat.completions.create({
model: "gpt-3.5-turbo-1106",
prompt: prompt,
max_tokens: 10000,
});
setAIOutput(response.choices[0].text)
}
}
I’m getting this error message: Uncaught (in promise) Error: 400 ‘messages’ is a required property
I’m new to this, so forgive me if this seems like an obvious question. Would anyone be so kind as to help me fix the syntax?