fonckchain / chatgpt-retrieval

Customizable ChatGPT retrieval tool. Use your own data to enhance AI conversations.

Repository from Github https://github.comfonckchain/chatgpt-retrievalRepository from Github https://github.comfonckchain/chatgpt-retrieval

ChatGPT

ChatGPT Retrieval

Simple script to use ChatGPT on your own files

Here's the Original YouTube Guide.

📦 Installation

Install Langchain and other required packages.

pip install langchain openai chromadb tiktoken unstructured

Modify constants.py.default to use your own OpenAI API key, and rename it to constants.py.

Place your own additional data into data.

✨ Example usage

Test reading data/data.txt file.

> python chatgpt.py "what is my dog's name"
Your dog's name is Lilia.

Test reading data/cat.pdf file.

> python chatgpt.py "what is my cat's name"
Your cat's name is Muffy.

🔄 Alternate Version

There's also an alternate version of the script that prioritizes retrieving answers from the dataset before using the OpenAI model. This can help reduce the cost of using the OpenAI API.

To use the alternate version, run the chatgpt_reduced_cost.py script instead of chatgpt.py.

> python chatgpt_alternate.py "what is my dog's name"
Your dog's name is Lilia.

About

Customizable ChatGPT retrieval tool. Use your own data to enhance AI conversations.


Languages

Language:Python 100.0%