Hi @singularblogs,
First of all I want to thank you for the great job you are doing with this excellent plugin.
Thanks a lot ??
I wanted to know if it is possible some option so that the answers given by the chatbot appear with the “Typing” effect (like chatgpt) so that the user can go reading the answer, sometimes, with an answer a little long or in 2 paragraphs, part of the text is hidden at the top and can confuse the user by having to scroll to retrieve the answer.
Normally, this effect is not used in traditional chatbots. However, it is used in ChatGPT for a very good reason: the answers are streamed from OpenAI servers in realtime (they come little by little, as they are generated), so it allows the users to appreciate them before the AI finishes the job.
Now, I know there are other systems or plugins that try to mimic that effects. I am not sure they understand technically why this effect happens at the first place, and they basically just try to replicate it without it being the real thing. By doing that, they get a side effect: since they don’t use streaming, they actually delay the time it takes to the user to see the whole answer. So with their solution, not only you get an somewhat unnatural effect, but the answer comes a bit later as well. Personally, I don’t think it’s a good choice, but just an attempt at pretending to be exactly like the famous ChatGPT ??
So basically, two ways:
- Using streaming. That typewriter effect is not really a isual effect, it’s actually what’s happening (and it’s kind of cool, right!). Unfortunately, in our case here, it would make the whole technical architecture tricky and limited, as it would require double streaming: OpenAI <> WordPress <> Front site. Of course, we could remove WordPress in the middle, but it means that we would need to have the API Key publicly disclosed, and we wouldn’t be able to do logging, taking over conversations (not that we can yet), limiting the requests, etc…
- No streaming, but imitating the effect. Not only it will look very robotic (and it’s a trick) but there will be a huge down side: we will not be able to use formatting in the reply (HTML, piece of code, etc). That effect would break it.
Luckily, there is an alternative solution: we should try to find an effect that looks nice, smooth, and don’t imply breaking the text. For example, once the answer is ready to be displayed, we could have an effect where the placeholder expands without showing the reply yet (but gets “ready” for it), then it would swiftly appear with a little opacity transition. That would look really cool, no trick, and it works without breaking any feature. I would love to know what you guys think.
I know you didn’t expect such a long answer, but I will refer to this when I am asked that question ??