openai / openai-node

The official Node.js / Typescript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.3k stars 762 forks source link

Openai.beta.threads.messages.create give "Unknown parameter: 'role'" #902

Open efisiobova opened 2 weeks ago

efisiobova commented 2 weeks ago

Confirm this is a Node library issue and not an underlying OpenAI API issue

Describe the bug

Creating a message as specified in the example on “Step 3” here: https://platform.openai.com/docs/assistants/overview

I got this error: BadRequestError: 400 Unknown parameter: ‘role’.

To Reproduce

const message = await openai.beta.threads.messages.create(
      threadId,
      {
        role: "user",
        content: "Some question here...",
      }
    );

Code snippets

No response

OS

Windows

Node version

Node v18.18.0

Library version

openai 4.51.0

indiyon commented 3 days ago

I have the same issue. Is there a solution?