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

Limit number of words streaming at a time - useChat #953

Closed
veerbal1 opened this issue Feb 2, 2024 · 2 comments
Closed

Limit number of words streaming at a time - useChat #953

veerbal1 opened this issue Feb 2, 2024 · 2 comments

Comments

@veerbal1
Copy link

veerbal1 commented Feb 2, 2024

Feature Description

Core OpenAI streaming response stream one word at a time e.g

Hello
!
How
can
I
help
you
?

Screenshot 2024-02-02 at 7 09 09 PM

But useChat from ai package stream like approx 3-4 words at a time. e.g

Hello! How
can I help
you?

Screen.Recording.2024-02-02.at.7.11.12.PM.mov

is there any option I can set word streaming limit at a time?

Use Case

For rendering smooth streaming of incoming response instead of flickering

Additional context

No response

@yuichiromukaiyama
Copy link

It seems that the Azure OpenAI API will return it that way, so is there a way to deceive it on the front-end...?

https://github.com/Azure-Samples/azure-search-openai-demo/blob/33bc5058e0e7249e78e3b0822ef3cca09d03101a/app/frontend/src/pages/chat/Chat.tsx#L84

@MaxLeiter
Copy link
Member

You'll need to handle this with your own code, as streaming can be performance / model dependent.

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

3 participants