# PNGTuber-GPT - An extension for Streamer.bot and Speaker.bot that brings AI to life for your Twitch stream

**URL:** <https://extensions.streamer.bot/t/pngtuber-gpt-an-extension-for-streamer-bot-and-speaker-bot-that-brings-ai-to-life-for-your-twitch-stream/555>\
**Category:** Approved\
**Tags:** twitch, api\
**Created:** [November 30, 2023, 1:15pm UTC](https://extensions.streamer.bot/t/pngtuber-gpt-an-extension-for-streamer-bot-and-speaker-bot-that-brings-ai-to-life-for-your-twitch-stream/555 "2023-11-30T13:15:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rapidrabbit](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rapidrabbit/32/1054_2.png) [@rapidrabbit](https://extensions.streamer.bot/u/rapidrabbit)\
**Post date:** [November 30, 2023, 1:15pm UTC](https://extensions.streamer.bot/t/pngtuber-gpt-an-extension-for-streamer-bot-and-speaker-bot-that-brings-ai-to-life-for-your-twitch-stream/555/1 "2023-11-30T13:15:13Z")

</div>

This extension requires you to have a paid OpenAI account and API key to use. The core extension is open-source and free, but there will be platform costs associated with usage.

## Description

An extension for Streamer.bot and Speaker.bot that brings AI to life for your Twitch stream. PNGTuber-GPT is built to make it easy for you to bring an AI character to life that can interact with your Twitch chat, and learn from your channel. It acts as you command it to, and can learn things from your viewers. All powered by ChatGPT. This solution’s core is a C# extension for Streamer.bot and utilizes Speaker.bot for it’s Text-to-Speech functionality. We are proud to be part of a rich ecosystem of extensions that you can use on your channel. No other software is required.

## Video Tutorial

[![](https://extensions.streamer.bot/uploads/default/original/2X/d/d862a0b89620ba15ae7a953a37fafaae5e904622.jpeg "PNGTuber-GPT: Getting Started") ](https://www.youtube.com/watch?v=rIzrd8WkUkU)

## Import Code

[PNGTuber-GPT.sb](https://extensions.streamer.bot/uploads/short-url/u9sJ3REA3KPFvO1VXAYE4ojPlr5.sb) (53.4 KB)

## Resources

- [Official Website](https://pngtubergpt.com)

## Installation

In Streamer.bot click the `Import` button in the top menu. Drag the **PNGTuber-GPT.sb** file into the `Import String` field.

### Create OpenAI Account

To access ChatGPT 3.5 Turbo, you need to have an active OpenAI account to retrieve an API key to use to send their API prompts from Streamer.bot. Signup for a new account on their website. Make sure to link a payment method to your account and convert to a paid account. By default your account has a hard limit of $120 per month, and you must request an increase to this limit if you should need more.

### Retrieve OpenAI API Key

Login to the OpenAI website, and navigate to your user in the top-right corner and click on “View API Keys.” Create a new secret key, and then save this for later. DO NOT lose this key or give it to anyone you don’t want to be able to charge your account. MAKE SURE YOU HAVE CONVERTED TO A PAID ACCOUNT BEFORE GENERATING YOUR API KEY! If not you will receive a (429) Too many requests error in the log file.

### Create GPT Bot Lore Text File

Your GPT bot needs to have a personality, backstory, likes, and dislikes. The better you build the deep lore, the more context the bot will respond to. You can “teach” the bot things by changing the wording of your lore file. You are basically digging into the AI’s brain and modifying their personality. Be creative, if you want your bot unhinged, tell them to be unhinged. You can also give negative prompting by telling them not to exhibit certain behaviors. A sample Lore file is provided below. You should save this as a text document. It is important to have a Traits section, Instructions, and a task that you expect them to do.

Download the context file from above and make sure context.txt is in your bot directory.

## Configuration

### Settings Configurations

OpenAI API Key - Your OpenAI API Key for accessing the OpenAI platform  
OpenAI Model - Either gpt-3.5-turbo or gpt-4  
Database Path - The path to the folder that has your context.txt in it  
Ignore Bot Usernames - A comma separated list of bot names to not save messages for  
Voice Alias - The voice alias to speak through  
Strip Emojis From Response - Whether to strip emojis that are returned in the response from GPT  
Logging Level - ERROR | WARN | INFO | DEBUG - indicates the logging level that should be output. Logs are saved to the Database Path under a logs directory.  
Version - Allows you to customize the version shown in chat when the !version command is run

### Moderation Settings

Each category can have a status of True or False. True indicates that category should not be moderated. False means that moderation will block responses that flag in that category.

### Discord Settings

Log GPT Questions to Discord - True will log messages to Discord, False will disable this functionality  
Discord Webhook URL - The webhook URL to log messages to  
Discord Bot Username - The username to log messages as  
Discord Avatar URL - A URL to an image to use for the profile picture on Discord for messages

## Commands

| **Command** | **Description** |
| --- | --- |
| **!modgpt {input}** | Allows moderators to ask the bot a question |
| **!modteach** | Allows a moderator to teach the bot something about themselves |
| **!modrememberthis {keyword} {definition}** | Allows moderators to save a keyword and definition for the bot to remember |
| **!modforgetthis {keyword}** | Allows moderators to make the bot forget a keyword and definition |
| **!curentnick** | Returns the user’s current nickname in chat |
| **!getmemory** | Return what the bot remembers about that user |
| **!help** | Return a list of available commands |
| **!modclearchathistory** | Clears the chat log sent to the bot with each response |
| **!modclearprompthistory** | Clears the chat log sent to the bot with each response |
| **!modforget** | Clears what the bot remembers about the moderator |
| **!modreinitialize** | Re-initializes the bot and global variables to memory |
| **!removenick** | Remove’s the user’s nickname from memory |
| **!sayplay** | Gets the bot to say !play for playing Marbles on Stream with viewers |
| **!setnick {input}** | Sets the user’s nickname that is sent to the bot with the chatlog and prompts |
| **!setpronouns** | Returns information on how the user can set their pronouns sent to the bot |
| **!speak {input}** | Allows mods to access TTS, and say what they want on stream |

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [January 1, 2024, 3:07am UTC](https://extensions.streamer.bot/t/pngtuber-gpt-an-extension-for-streamer-bot-and-speaker-bot-that-brings-ai-to-life-for-your-twitch-stream/555/2 "2024-01-01T03:07:50Z")

</div>

Seems to be looking good, the only “issue” I would see would be that there is no direct link to the github page or direct download in the post to download the context.txt.  
Had to look around a bit til I actually saw the github link in the header of the website as in the post it mentions " Download the context file from above" which can be misinterpreted as above there should have been another file to download.

Edit: Adding to this I just realized that certain .dll’s are not able to be located as they are references to folder you have. Compiles fine but can probably just remove those references lol

Microsoft.Bcl.AsyncInterfaces.dll  
System.Threading.Tasks.Extensions.dll  
Newtonsoft.Json.dll  
Microsoft.CodeAnalysis.dll  
System.Collections.Immutable.dll  
System.Text.Encodings.Web.dll

---

<div class="post-metadata">

**Author:** ![rapidrabbit](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/rapidrabbit/32/1054_2.png) [@rapidrabbit](https://extensions.streamer.bot/u/rapidrabbit)\
**Post date:** [January 11, 2024, 5:30pm UTC](https://extensions.streamer.bot/t/pngtuber-gpt-an-extension-for-streamer-bot-and-speaker-bot-that-brings-ai-to-life-for-your-twitch-stream/555/3 "2024-01-11T17:30:34Z")

</div>

Sorry for the lack of reply here. I’ve been busy trying to get 1.1 finished. I did remove those references in the latest nightly. The reason that it said “download the context file from above” was originally I had both the GitHub link and the context file download above in Resources; but I ran into a technical issue where I didn’t seem to have the permissions to add more links to the post. I tried editing it after and got the same error. Perhaps you can grant me the permissions needed, and I can update it appropriately. Once I get 1.1 out I will return and resubmit this for approval. There are a number of changes that need to still be reflected here.

---

<div class="post-metadata">

**Author:** ![pwnyy](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/pwnyy/32/2970_2.png) [@pwnyy](https://extensions.streamer.bot/u/pwnyy)\
**Post date:** [January 15, 2024, 3:12am UTC](https://extensions.streamer.bot/t/pngtuber-gpt-an-extension-for-streamer-bot-and-speaker-bot-that-brings-ai-to-life-for-your-twitch-stream/555/4 "2024-01-15T03:12:16Z")

</div>

Whenever you have issues with permissions of your post please let us know either on the Extension or SB Discord, probably best in the Extension one. That way we might see it earlier and can check on it 🙂 Just let us know when you update it to 1.1 that way we can review it again!
