Commandline chatbot to learn about the constituition of ghana!
This chatbot helps you learn about the constituion of ghana, it can answer any questions that relates to the 1996 constituition of Ghana. Have fun!.
- Python3 (https://www.python.org/)
- pipenv (https://pipenv.pypa.io/en/latest/)
- Azure OpenAI keys (https://azure.microsoft.com/)
- clone the repo
- run
pipenv install
- run
pipenv shell
- run
pipenv run python3 app.py
How can I become a citizen of Ghana?
- PyPdfLoaderReads reads the document from the path provided into array of documents, where each document contains the page content and metadata with page number,and splits them into chunks.
- The pdf chunks are then passed into chromadb which creats embeddings for them using the AzureOpenAIEmbeddings.
- When a prompt is received, the prompt is passed to chromadb which them creates embeddings and does a similarity check to retrieve results that correspond to the prompt
- The results together with the prompt is then passed to the llm using "rlm/rag-prompt" to make sense out of it and the response is printed to the screen.
This project can be adapted for any use case, just change the pdf file to any pdf of your choice and you will have the same functionality. enjoy!
If you have any feature reaquest, feel free to reach out to me or contribute!
- Fork the repo
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request