Using LangChain, GPT-3.5, and Chain of Thought reasoning to create a Dungeons and Dragons type experience.
LangQuest is written in Python 🐍 and uses Streamlit for the front end. Streamlit is an open-source framework that provides a quick interactive web app.
Some of the features that make LangQuest unique and fun are:
- Image generation: LangQuest uses image generation to enhance the visual aspect of the game. You can see pictures of the places, characters, and items you encounter in your adventure.
- Hitpoints: You have a health bar that decreases when you take damage and increases when you heal. If your hitpoints reach zero, you lose the game.
- Location: Persistent location, kept track of by the Dungeon Master. You can move around the world and explore different places.
- Inventory: You have a backpack that stores the items you find or buy along your journey. You can use them for various purposes, such as healing, attacking, or solving puzzles.
- Storyline: You can choose from different scenarios that set the background and the goal of your adventure. Each scenario has multiple endings depending on your choices and actions.
- Customisable scenario: You can also create your own scenario by changing the setup. LangQuest will generate a new world for you to explore based on your input.
- Get an OpenAI API Key
- Clone the repo to somewhere locally.
- Add a new file in the root called
api.txt
- This file should be next to
main.py
- Inside the file, paste your API Key, so the contents of the file looks like
- This file should be next to
sk-aBcDeF***************************************XyZ
- (Optional) Create a virtual environment with
python3 -m venv .venv
- Linux/MacOS, enter the env with:
source .venv/bin/activate
- Windows Powershell, enter with:
.venv/Scripts/Activate.ps1
- Linux/MacOS, enter the env with:
- install required packages:
pip install -r requirements-dev.txt
- Ensure streamlit installed correctly by running the command below. If this fails, see Here for more information.
streamlit hello
Run the command:
streamlit run main.py