Twitch chat GPT Completion Bot
This bot allows users to query GPT-3 completions inside a Twitch chat. Simply type !ai <text-to-complete>
and the bot will respond with a completion generated by GPT-3.
You can either run pre-built latest executable for windows or run from source code or build your own executable.
Latest .exe file that you can download and run
Requirements
- A Twitch account
- An OpenAI API key (register at their website and go to account -> api keys, read disclaimer down below for more info)
Installation
Clone this repository to your local machine:
git clone https://github.com/vodkabydlo/GPT-Twitch-Chatbot.git
Then get to the directory the bot is in and install all dependencies:
npm install
To run the app from terminal
npm run start
to build a standalone .exe
npx electron-builder build --win portable
Usage
One token is approximately 4 characters in english language. All other languages are more expensive and therefore with a set amount of tokens replies in other languages will be shorter.
Set amount of tokens in the app to set maximum amount of tokens to be spent on each completion. I found it perfect between 50 and 200 tokens. Less tokens you spend the dumber and shorter responses will be, so for clever responses use 150-200.
Twitch messages are limited in characters (approx. 500). The bot will split messages if OpenAI's reply is too long and split
To query a GPT-3 completion, simply type !ai <prompt>
in the Twitch chat. The bot will respond with a completion generated by GPT-3.
For example, if you type !ai The quick brown fox jumps over the lazy dog
, the bot might respond with
The quick brown fox jumps over the lazy dog, but then it turns around and jumps back again just for fun.
Disclaimer
- This bot uses the OpenAI GPT-3 API, which may generate offensive or inappropriate completions. Use at your own risk.
- Also keep in mind that the bot is using commercial OpenAI API. Initially as of December 2022 OpenAI give you $18 of free credit and several months to test it. To use it further you will need to pay for GPT.
- Since bot is using tmi.js, the response of GPT will be from your name.