SimonB97 / BG3Chat

BG3Chat is a chatbot that can answer questions about the game Baldur's Gate 3 by indexing content from bg3.wiki and performing Retrievel Augmented Generation.

Home Page:https://bg3chat.streamlit.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐Ÿฐ๐Ÿ”ฎ BG3Chat - Baldur's Gate 3-Wiki Chatbot

Welcome to the BG3Chat repository! This educational project is a labor of love, designed to help fans of the game find the information they need quickly and easily. It's a simple tool, but one that I hope you'll find useful.

preview.mp4

๐Ÿค” What is this?

BG3Chat is a chatbot that uses a combination of web scraping and data augmented generation to provide answers to questions about the game Baldur's Gate 3. It scrapes content about Baldur's Gate 3 from bg3.wiki, builds an index, and generates responses to user queries based on this indexed content.

The chatbot is designed to be used with the Streamlit library for a user-friendly interface. It also uses Langchain and the OpenAI API for generating responses and the BeautifulSoup library for web scraping.

๐Ÿš€ Quick Start

Quick and easy access at:

โ˜› bg3chat.streamlit.app โ˜š

If you want to run the app locally to make changes or update the index, please follow the installation and usage instructions below.

๐Ÿ”ง Installation

To get started, you'll need to clone this repository to your local machine. From there, you can install the necessary dependencies using pip:

pip install -r requirements.txt

You'll also need to provide your OpenAI API key, which you can get from the OpenAI website.

๐Ÿ’ฌ Usage

Once you've installed the necessary dependencies you can start the chatbot by running the bg3_chat.py script:

streamlit run BG3Chat.py

This will start the Streamlit server and open the chatbot in your web browser.

๐Ÿ“ Updating the Indexed Wiki Content

If you want to update the indexed wiki content, you can simply remove the scraped_text_https___bg3_wiki_.txt file and the https___bg3_wiki_ folder. The chatbot will automatically re-scrape the wiki and re-index the content the next time you run it. Keep in mind that this queries the OpenAI API, so you may incur additional costs if you do this frequently. ๐Ÿ’ธ

๐Ÿ› ๏ธ Customizing the Chatbot

On the left side of the chatbot interface, you'll find a sidebar where you can customize your chatbot experience.

  • OpenAI API Key: Enter your OpenAI API key here. This is necessary for the chatbot to function.

  • Summarize Chain Type: This option allows you to pick how the chatbot processes and presents the information it finds:

    • Stuff: Quick mode with answers based on a limited number of sources.
    • Map-reduce: A more thorough mode that takes a bit longer but can summarize any number of sources.
    • Refine: Ideal for detailed questions, it takes longer but ensures accuracy by examining any number of sources in-depth.
  • Model: Select the OpenAI model the chatbot uses to generate responses. Options include 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k', and 'gpt-4-0613'.

  • Number of documents retrieved per wiki search: Use the slider to adjust the number of documents the AI Agent retrieves for each index search. More documents can provide more comprehensive answers, but may also slow down response time and lead to higher costs for OpenAI API usage.

Remember to click 'Clear Message History' if you want to start a new conversation.

๐Ÿ‘ฅ Contributing

I'm always open to contributions and would be thrilled to have you join in on this project. Whether you're fixing bugs, improving documentation, or proposing new features, your efforts are greatly appreciated.

๐Ÿ™ Acknowledgements

I'd like to express my gratitude to the team behind the Baldur's Gate 3 Wiki. Their dedication to compiling and organizing a vast amount of information about the game has made this project possible. The chatbot relies heavily on the content provided by the BG3 Wiki, and I am deeply appreciative of their efforts.

๐Ÿ”‘ License

This project is licensed under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license. You are free to share, copy, redistribute, remix, transform, and build upon the material, as long as you follow the license terms.

๐Ÿ’ญ Final Thoughts

This project is a humble attempt to make the vast world of Baldur's Gate 3 a little more accessible. It's not perfect, and there's always room for improvement. But I hope it can help you in your journey through the game. Enjoy!

About

BG3Chat is a chatbot that can answer questions about the game Baldur's Gate 3 by indexing content from bg3.wiki and performing Retrievel Augmented Generation.

https://bg3chat.streamlit.app/


Languages

Language:Python 100.0%