GithubHelp home page GithubHelp logo

ammarfahmy / chainlit-langchain-openai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sudarshan-koirala/langchain-openai-chainlit

0.0 0.0 0.0 563 KB

Chat with your documents (pdf, csv, text) using Openai model, LangChain and Chainlit

License: MIT License

Python 100.00%

chainlit-langchain-openai's Introduction

langchain-openai-chainlit

Chat with your documents (pdf, csv, text) using Openai model, LangChain and Chainlit.
In these examples, we’re going to build an chatbot QA app. We’ll learn how to:

  • Upload a document
  • Create vector embeddings from a file
  • Create a chatbot app with the ability to display sources used to generate an answer

Chat with your documents πŸš€

System Requirements

You must have Python 3.11 or later installed. Earlier versions of python may not compile.

When using python 3.10, got the following error message. Need to use python 3.11.

Alt text


Steps to Replicate

  1. Fork this repository and create a codespace in GitHub as I showed you in the youtube video OR Clone it locally.
git clone https://github.com/sudarshan-koirala/langchain-openai-chainlit.git
cd langchain-openai-chainlit
  1. Rename example.env to .env with cp example.env .envand input the OpenAI API key as follows. Get OpenAI API key from this URL. You need to create an account in OpenAI webiste if you haven't already.

    OPENAI_API_KEY=your_openai_api_key
    
  2. Create a virtualenv and activate it

    python3 -m venv .venv && source .venv/bin/activate
    

    If you have python 3.11, then the above command is fine. But, if you have python version less than 3.11. Using conda is easier. First make sure that you have conda installed. Then run the following command.

    conda create -n .venv python=3.11 -y && source activate .venv
    
  3. Run the following command in the terminal to install necessary python packages:

    pip install -r requirements.txt
    
  4. Run the following command in your terminal to start the chat UI:

    chainlit run pdf_qa.py -w
    chainlit run txt_qa.py -w
    chainlit run pdf_txt_qa.py -w
    chainlit run csv_qa.py -w
    

Disclaimer

This is test project and is presented in my youtube video to learn new stuffs using the openly available resources (models, libraries, framework,etc). It is not meant to be used in production as it's not production ready. You can modify the code and use for your usecases ✌️

chainlit-langchain-openai's People

Contributors

sudarshan-koirala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.