Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
efisiobova opened this issue Jun 19, 2024 · 2 comments
Open
1 task done
Assignees
Labels
bug Something isn't working

Comments

@efisiobova
Copy link

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

  • This is an issue with the Node library

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

@efisiobova efisiobova added the bug Something isn't working label Jun 19, 2024
@indiyon
Copy link

indiyon commented Jul 5, 2024

I have the same issue. Is there a solution?

@Zacros
Copy link

Zacros commented Jul 17, 2024

If for some reason your threadId is empty, you will get this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants