Utilizes a vector database and OpenAI API.
Install necessary packages with pip install -r requirements.txt
.
Create a /.env
file and set your OpenAI key as follows: OPENAI_API_KEY = [OPENAI KEY]
Add the information you want to use into information.txt
. For instance, you can scrape an entire Wikipedia page and add it.
Run python embedding_test.py "Your question"
For example: python embedding_test.py "Explain about Russia's invasion in Ukraine"
The required embedding model will automatically be downloaded to /nltk_data
. There is no need for you to manually manage this.
Run python embedding_conversation.py "Your question"
For example: python embedding_conversation.py "Let's talk about Russia's invasion in Ukraine"
A faiss.index
file will automatically be created in the /conversation
directory. If you modify the contents of information.txt
, make sure to delete the /conversation/faiss.index
file beforehand.
The dialogue of the conversation is stored in /conversation/messages.pkl
. If you want to reset the conversation history, delete this file.