/ChatGPT--Custom-Knowledge-Chatbot-Multiple-Files

ChatGPT- Custom Knowledge Chatbot(Multiple Files like PDFs, Text, etc) using Langchain

Primary LanguagePythonMIT LicenseMIT

ChatGPT--Custom-Knowledge-Chatbot-Multiple-Files

ChatGPT- Custom Knowledge Chatbot(Multiple Files like PDFs, Text, etc) using Langchain

Introduction

Simple script to use ChatGPT on your own files.

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 data into data/data.txtor data/data.pdf.

Example usage

  • Test reading data/data.txt file.

    > python chatgpt.py "what is my dog's name"
    Your dog's name is Sunny.
    
  • Test reading data/data.pdf file.

    > python chatgpt.py "what is my cat's name"
    Your cat's name is Muffy.
    
  • Test reading data/ directory.

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