
DungeonBot is a little program designed to enhance your roleplaying game (D&D) experience. This is ideal for NPCs/Narrators as you can interact with an AI (GPT-3.5-Turbo) using mic input and it provides you with tailored responses with all the details of your world. DungeonBot uses the ElevenLabs voice of your choice to bring the AI's responses to life, making your sessions even more engaging and often (unintentionally) funny.
You give the AI context and instructions such as "You are in Middle Earth and are a cocky, aggressive dwarf", use your mic and get a spoken response in character from the AI (You can choose from many voices from ElevenLabs). It also keeps a chat history so the AI can remember things you've previously said (full_chat_history.json)
DungeonBot.Demo.Video.mp4
(Sound on)
Note: Hopefully this is accessible for non-technical people, but if not, you can copy/paste these instructions into ChatGPT and have it guide you through the install!
Follow these steps to set up DungeonBot:
- Download this project: Download this project by clicking the green code button in the top right and clicking "Download ZIP":
- Install Python: Download Python (https://www.python.org/downloads/) (any recent version will do). When installing, check the "Add to Path" option in the installer.
- Install Dependencies:
Open command prompt in the project folder and install the required dependencies:
cd DungeonBot pip install -r requirements.txt
- Get API Keys: To interact with the AI (GPT-3.5-Turbo) and use the AI voice (ElevenLabs), you need API keys (you can think of these as personal account keys). You can obtain these keys by signing up to GPT-3.5-Turbo and ElevenLabs. Here you can choose the voice you want to use.
- Configure API Keys: Edit the "config.json" file using a text editor and add your API keys (Once you've added a voice to your voice library you can also change it to that here):
"GPT": { "api_key": "Your API key here" }, "eleven_labs": { "api_key": "Your API key here", "voice": "Victoria" }
- Edit your system prompt: Now you can give the AI context! The system prompt is the initial instructions that the AI will always bear in mind. Edit the prompt to whatever you want in the gpt_api.py file:
- Run the Program: Now you're ready to run DungeonBot. Launch the program using the following command:
cd DungeonBot python main.py
-
Start the Program: Run the program using the above command.
-
Microphone Input: DungeonBot will listen to your microphone input. Say your context, question, or prompt.
-
AI Response: The program will send your input to GPT-3.5-Turbo and retrieve an in-character response.
-
Voice Playback: The AI-generated response is played back using ElevenLabs' voice (remember you can choose any voice!).
I welcome contributions from the community to make DungeonBot better. If you have any suggestions, bug fixes, or new features to add, feel free to create a pull request.
Some examples of the responses provided by DungeonBot:
DungeonBot.Responses.mp4
This project uses the GPT-3.5-Turbo API to generate text responses and the ElevenLabs API to generate the audio for those responses.
This project is licensed under the MIT License.