-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Chat completions stream not working on flutter web #21
Comments
Hello, thank you for reaching out here! |
Hey thanks for answering so quickly. The behavior on 1.8.3 is the same. Testing on Chrome(web-javascript)
I was able to get the behavior I expected using a custom fetch client built around the fetch API. There's a limitation on browsers with XHR, it won't support streams anytime soon and there's a forgotten debate on dart:http wether they will support fetch or not. Streamed responses are necessary for this type of apis. Implementing it to be supported by this package would be awesome. Let me know If I can help with a PR. Would love to contribute. It would probably just need to check if the platform is web then use custom FetchClient for postStream method in the client.dart file. My team will most likely try to support this and fetch because our software has a heavy dependency on them. Let me know your toughts! |
Well I've been running circles around this issue all day. Perhaps someone here can help me. I'm trying to make a chatbot demo with the package. It works wonderfully until we test on flutter web. Instead of receiving the response word by word the browser seems to be buffering the data and then sending the whole response.
Is there a workaround? I've found that using dart:html could be a possible fix but I'm not sure.
The behavior I expect is to be able to get the ChatGPT response word by word.
The text was updated successfully, but these errors were encountered: