DocReader is a Python script that uses GPT to help you communicate with your txt, pdf, code files and more.
You can use either OpenAI API with gpt-3.5-turbo or gpt-4.
Set gpt4 = False
for gpt-3.5-turbo or gpt4 = True
for gpt-4
- When switching between models, rename one of the files in the data folder to ensure that the changes take effect.
For shorter answers, set 'similarity_top_k' to lower value in this line:
query_engine = index.as_query_engine(similarity_top_k=5)
- OpenAI API key:
- Create openai api key in https://beta.openai.com/.
- Create a .txt file and copy your openai api key and save it as
openai_api_key.txt
. - Replace
path_to_key
in connect_to_openai function with the path to youropenai_api_key.txt
file.
- Clone the repository
- Install the requirements
pip install -r requirements.txt
- Save files in 'data folder'
- Run the script
- Ask questions about the data in the data folder.