David Herman
12/15/2023, 4:22 AMkobweb create examples/chatgpt
).
Important: To run it locally yourself, you'll need to be able to create and provide your own API key from https://platform.openai.com/api-keys
It's been a while since I first worked on it, and the first version was functional but just paused for 10 seconds and then dumped all text at once. Since that time, Kobweb added a new feature called API streams (https://github.com/varabyte/kobweb#define-api-streams), and I wanted to see if I could update the sample to do the same text streaming thing that the ChatGPT site does.
As you can see, it works! No promises that it's amazing code, but the sample has been updated.