This repository contains two Python programs that utilize the OpenAI API to search for answers to user-provided questions within text and PDF files.
- OpenAI Text File Searcher: Searches for answers within a single text file.
- OpenAI Directory Searcher: Searches for answers within multiple text and PDF files in a specified directory.
- Clone this repository or download the source code.
- Install the required dependencies by running
pip install -r requirements.txt
.
- Set your OpenAI API key in the
openai_text_file_searcher.py
file. - Run the script using
python openai_text_file_searcher.py
. - When prompted, enter your question.
- The script will search the specified text file for an answer using the OpenAI API and display the results.
- Set your OpenAI API key in the
openai_directory_searcher.py
file. - Run the script using
python openai_directory_searcher.py
. - When prompted, enter your question.
- The script will search all text and PDF files within the specified directory for an answer using the OpenAI API and display the results.
This project is licensed under the MIT License. See the LICENSE file for details.