Skip to content

server : fix first message identification #13634

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

doringeman
Copy link

When using the OpenAI SDK (https://github.com/openai/openai-node/blob/master/src/lib/ChatCompletionStream.ts#L623-L626) we noticed that the expected assistant role is missing in the first streaming message. Fix this by correctly checking for the first message.

When using the OpenAI SDK (https://github.com/openai/openai-node/blob/master/src/lib/ChatCompletionStream.ts#L623-L626) we noticed that the expected assistant role is missing in the first streaming message. Fix this by correctly checking for the first message.

Co-authored-by: Piotr Stankiewicz <[email protected]>
Signed-off-by: Dorin Geman <[email protected]>
ngxson
ngxson previously approved these changes May 19, 2025
Copy link
Collaborator

@ngxson ngxson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, but would be appreciate if you can modify one of the test case to test for this

@ngxson ngxson dismissed their stale review May 19, 2025 13:57

This breaks a test case, please fix it first

Co-authored-by: Piotr Stankiewicz <[email protected]>
Signed-off-by: Dorin Geman <[email protected]>
@doringeman
Copy link
Author

Thanks @ngxson! We fixed and added comments for the first role message that comes with stream=True.

@github-actions github-actions bot added the python python script changes label May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples python python script changes server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants