How can I make a Chat animation?

Im making a chatbot and want it to have a text animation when its typing the words to the answer. Is there an option to do this in HTML, CSS, and Django?

1 Like

First, you need to set stream to true when you call the Chat completion API to enable streaming like what you see in ChatGPT site. Then get a Typewriter effect library (e.g. typewriter-effect) to show typing animation when you display the text as it is being streamed.

1 Like

Here we go:
https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb

As an MVP you can actually just skip the streaming and go straight to typewriter. Then you can decide if it is good enough or if you want a faster streamed response. But, I suspect the typewriter effect will give you enough of a false sense of streaming no one will really notice.

1 Like