Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lambda-science/dnd-qa
https://github.com/lambda-science/dnd-qa
Last synced: about 15 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/lambda-science/dnd-qa
- Owner: lambda-science
- License: mit
- Created: 2023-03-10T17:12:10.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-30T08:51:53.000Z (12 months ago)
- Last Synced: 2025-01-09T23:46:26.992Z (8 days ago)
- Language: Python
- Size: 4.94 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🗡️D&D Spell QA Bot🗡️
This is a chatbot that can answer questions about **Dungeon and Dragons spells** based on this [database](https://www.aidedd.org/dnd-filters/spells-5e.php) and built with LangChain and OpenAI API. Usefull to find informations quickly instead of browsing through 50 pages of PDF.
The creator of this bot is **[Corentin Meyer (@corentinm_py)](https://twitter.com/corentinm_py)**.
💪 This bot it based on Notion Question-Answering demo from [LangChain](https://github.com/hwchase17/langchain)# 🌲 Environment Setup
In order to set your environment up to run the code here, first install all requirements and then launch streamlit app:
```shell
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run main.py
```Then set your OpenAI API key (if you don't have one, get one [here](https://beta.openai.com/playground))
```shell
export OPENAI_API_KEY=....
```## 🚀 Code to deploy on StreamLit
The code to run the StreamLit app is in `main.py`.
Note that when setting up your StreamLit app you should make sure to add `OPENAI_API_KEY` as a secret environment variable.## 🧑 Reproduce the embedding and stuff
Run the following command to ingest the data.
```shell
python ingest.py
```Boom! Now you're done, and you can ask it questions like:
```shell
python qa.py "What's the size of tsunami spell ?"
```