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

docs: Fix incorrect use of stream api event #694

Closed
wants to merge 3 commits into from

Conversation

iovecoldpizza
Copy link

@iovecoldpizza iovecoldpizza commented Feb 25, 2024

  • [ ✓] I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Update the use of stream API event

Additional context & links

The example involved is about streaming response of Chat Completion, instead of Assistant.
As per https://github.com/openai/openai-node/blob/master/helpers.md#user-content-onchunk-chunk-chatcompletionchunk-snapshot-chatcompletionsnapshot---with-stream, the event "content" is for use with assistant API, while to obtain response chunk from Chat Completion API, "chunk" event should be used instead.
Also the "delta" object structure is different.

@iovecoldpizza iovecoldpizza requested a review from a team as a code owner February 25, 2024 06:52
@rattrayalex
Copy link
Collaborator

I don't believe the docs are incorrect. .on('content' is indeed a convenience in the chat completion streaming helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants