Hi, i use Firebase Cloud Function and React for my project.
i keep getting this error in my functions console and error 500:
error: {
message: "Missing required parameter: 'content'.",
'invalid_request_error',
param: 'content',
code: 'missing_required_parameter'
I have tried multiple ways to fix this. no luck…
front-end code sends messages as content and here is the code from the function
try {
const decodedToken = await admin.auth().verifyIdToken(idToken);
const userId = decodedToken.uid;
// Create a Thread
const thread = await openai.beta.threads.create();
// Add user message to the Thread
const userMessage = req.body.message;
await openai.beta.threads.messages.create(thread.id, {
role: 'user',
content: userMessage,
});
I use the latest Node SDK and I’m trying to create an Assistant base on GPT 4 turbo.
thank you