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

[Request] Supports event-streams #55

Closed
gtk2k opened this issue Dec 8, 2022 · 4 comments
Closed

[Request] Supports event-streams #55

gtk2k opened this issue Dec 8, 2022 · 4 comments

Comments

@gtk2k
Copy link

gtk2k commented Dec 8, 2022

By supporting event-stream, the response will be experientially faster.
image

@transitive-bullshit
Copy link
Owner

@gtk2k we're already using an event-stream parser for responding to the request. Is there a specific change that you're suggesting?

@transitive-bullshit
Copy link
Owner

I just performed a few tests with and without the Accept: 'text/event-stream' header. I wasn't able to notice any significant difference between the two.

One thing to keep in mind is that it can feel like the responses take longer when you're not seeing the partial response as ChatGPT is "typing". If you compare the time it takes to fully resolve an api.sendMessage vs your browser devtools, it will be very similar.

To view the stream of partial responses with chatgpt, you can use the onProgress or onConversationResponse parameters to api.sendMessage.

@gtk2k
Copy link
Author

gtk2k commented Dec 8, 2022

Thank you. I got the expected behavior.
If possible, it would be nice if onProgress was also written in the README.

@gtk2k gtk2k closed this as completed Dec 8, 2022
@transitive-bullshit
Copy link
Owner

Just added a note to the readme 👍

cyhhao pushed a commit to cyhhao/chatgpt-api that referenced this issue Feb 8, 2023
…e-readme

📝 Update doc for docker and usage
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

No branches or pull requests

2 participants