A chatbot that tells you about the Centro di Sonologia Computazionale (CSC) of the University of Padova and its people.
Requirements:
- Python 3.10 or higher
- Poetry for managing dependencies or pip
- Makefile to run commands (optional)
To install the project from source you can download the repository:
git clone https://github.com/matteospanio/csc-chatbot.git
cd csc-chatbot
Then you can install the dependencies with Poetry:
poetry install
If you don't have Poetry installed, you can install the project with pip by running the following command in the project root directory:
pip install -e .
Otherwise you can install just the dependencies with pip:
pip install -r requirements.txt
Configuration is done through the config.yml
to set the models parameters. In addition you need to set some environment variables:
- OPENAI_API_KEY to use the OpenAI API
- PDF_PATH, the path to the PDF files to load
- DATA_PATH, the path to the web links to load
- CHROMA_PATH the folder name where to store the chroma database files
- CHAT_MEMORY the file name where to store the chat messages history
If you have Poetry installed, you can run the chatbot with the following command:
poetry run chatbot --help
or enter the virtual environment with:
poetry shell
and then run the chatbot with:
chatbot --help
If you installed the project with pip, you can run the chatbot with:
chatbot --help
If you installed only the dependencies with pip, you can run the chatbot with:
python src/chatbot/ --help
The CLI chatbot has the following commands:
--help
: show the help message--version
: show the version of the chatbotchat
: start the chatbotingest
: setup the chatbot
chat
starts the chatbot and you can ask questions about the CSC and its people.
setup
is used to setup the chatbot memory. It will read the data from the data
directory and store it in the chatbot memory. It accepts two flags:
--with-pdf
: Load the PDF files in thedata/pdf
directory, extract the text and store it in the chatbot memory--with-web
: Load the web pages in thedata/csc.yml
file, extract the text and store it in the chatbot memory
This project is licensed under the MIT License - see the LICENSE file for details.