GithubHelp home page GithubHelp logo

simonb97 / bg3chat Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 16 MB

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/

Python 100.00%

bg3chat's Introduction

๐Ÿฐ๐Ÿ”ฎ 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 retrival augmented generation (RAG) 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!

bg3chat's People

Contributors

simonb97 avatar

Stargazers

 avatar Testi Otapo avatar Fadhil avatar  avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.