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

Node Client does not provide empty system message, influencing API output compared to API Playground #1133

Open
1 task done
piazzatron opened this issue Oct 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@piazzatron
Copy link

piazzatron commented Oct 16, 2024

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

The official OpenAI API Playground and this Node client may differ significantly in their Chat Completion responses, despite having the exact same request parameters, because the playground will insert an empty system message and the node client does not.

You could make an argument this is a bug with the OpenAI playground rather then this client, but starting here.

The request in question in the playground:
Screenshot 2024-10-16 at 2 17 25 PM

The node client code suggested from the playground (note no empty system message):
Screenshot 2024-10-16 at 2 18 16 PM

If you actually inspect the chrome traffic, however, note the presence of the empty system message:
Screenshot 2024-10-16 at 2 19 52 PM

If you run the exact suggested client code from the playground, the generated API request does not have the empty system message (confirmed via proxying HTTP traffic from my machine):

Screenshot 2024-10-16 at 2 23 21 PM

Adding the empty system message manually fixes the issue.

Pretty significant bug IMO, spent hours trying to figure out if this was real or if I was chasing ghosts. There are many topics on the forum about API playground requests differing from the Node client - this may explain a handful of them.

To Reproduce

Follow isntructions above.

Code snippets

No response

OS

MacOS

Node version

Node v20.15.1

Library version

4.67.3

@piazzatron piazzatron added the bug Something isn't working label Oct 16, 2024
@piazzatron piazzatron changed the title Node Client does not provide empty system message, influencing API output compared relative to API Playground Node Client does not provide empty system message, influencing API output compared to API Playground Oct 16, 2024
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

1 participant