#Working with nextjs and this error "Property 'content', 'role' does not exist on type 'Openai'

1 messages · Page 1 of 1 (latest)

fervent vigil
#

Of course the app functions perfectly well even with this error and with no errors produced when in use. But when launching on versal the error halts deployment. Any ideas?

send this data to page: return NextResponse.json(response.choices[0].message)

setting const:

const userMessage: ChatCompletionRequestMessage = { role: "user", content: values.prompt };
const newMessages = [...messages, userMessage];
const response = await axios.post("/api/code", {messages: newMessages})
setMessages((current) => [...current, userMessage, response.data]);

but accessing that data here is where the error shows in ide: