![](https://godotforums.org/assets/files/2023-08-30/1693379357-288922-chagt-stream-godot4.gif)
https://github.com/oceanbuilders/ChatGPT-stream-for-Godot-4
This MIT licensed project combines a few features to produce a smooth chat experience with ChatGPT:
OpenAI's ChatGPT with stream enabled.
The HTTPSSEClient add-on by Kyle Szklenski, ported to Godot 4 and adapted to this project, allowing for showing the AI response before the model generates the full responses. This reduces dramatically the delay in long replies, specially if GPT-4 is used.
The godot-elevenlabs-tts script , part of the Gotot 4 AI NPC example by teddybear082, for high quality text-to-speech using ElevenLabs API.
Text-to-speech using the built-in Godot 4 TTS system, that relies on the OS TTS voices.
A queuing system for being able to push several AI messages one after the other, and process them at whatever speed is desired.
Godot's RichTextLabel nodes using BBcode
AI's status messages to present a "Thinking..." message during the small delay before starting to receive the ChatGPT reply.
Word by word injection of the AI message into the RichTextLabel with independent control of the speed in which words appear. So even if the model is able to provide all the words at a very fast speed you may choose to present them to the user at a slower speed.
There are some limitations, please check the README in the GitHub project.