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

Typing effects #1

Open
tuyendv-it opened this issue Aug 10, 2023 · 2 comments
Open

Typing effects #1

tuyendv-it opened this issue Aug 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@tuyendv-it
Copy link

I appreciate your work. But I have 1 problem how to get "typing effect" like ChatGPT?

@heissanjay heissanjay added the enhancement New feature or request label Aug 10, 2023
@heissanjay
Copy link
Owner

heissanjay commented Aug 10, 2023

Thanks, first for all. I'm glad that you are interested. I thought of adding that typing effect, but due to some consideration I dropped it. As mentioned in the repo description, it utilizes Azure OpenAI API for core functionality. When the user enters the prompts, that request will be sent to the backend, then that hits the Azure OpenAI service. So, the response from the Azure OpenAI service directly hits the backend all at once, instead of streaming chunks of response like ChatGPT does. then we sent the response as whole to the frontend.

we can still achieve that effect either from backend or frontend, like after getting the response whole at once from Azure OpenAI service, we can present the response to user as chucks to simulate that typing effect.

Reason Why I dropped that idea is the response time. already the data travels the long path, processing that response data in our side might increase the waiting time.

TBH, I'm interested in implementing that effect and test it to see if the response time is reasonable. Maybe I'll work on that on my free time or else if you are interested in that, your PR is more welcomed (if you are into web dev).

@tuyendv-it
Copy link
Author

Thank you for your very helpful response. I also hope the project achieves certain successes.
In addition, I have a few to share as follows:

  1. Personally, using OpenAI is a “Generative AI” mechanism. More specifically, I can understand that the data generated from OpenAI will have no endpoint and must wait until the end to receive a complete answer.
  2. We see "typing effect" as I understand it is a way of returning data so that the user feels like: "Well, they respond immediately without waiting".
  3. I used EventSource for this task and luckily I was able to reproduce the "typing effect" directly on the chat window.

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

No branches or pull requests

2 participants