This is a simple demo that shows how to build your own ChatGPT bot on the web. Source code available here. It's hosted on Autocode, a serverless Node.js development platform specialized in shipping bots, webhooks and APIs with first-class support for streaming web responses.
Code powering the chatbot is in functions/chat.js
.
The API exported from that file will generate a text/event-stream
response if triggered with a ?_stream
query parameter in the
url. When we press the [Send] button below, we start a
Server-sent Event
session with the endpoint. This script powering the front-end
is available in www/script.js
.
As we receive a stream of results, we display the output in chat.
Want this bot for your Discord server instead? Check out DiscordGPT instead. You can follow us on Twitter at @autocode or join us on Discord at discord.gg/autocode.