Skip to content

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

Open
@piazzatron

Description

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions