Skip to content

Langchain Q&A Demo is a Streamlit-based web application that uses Langchain and OpenAI’s GPT-3.5-turbo to provide interactive question-and-answer functionality. Users can input questions and receive AI-generated responses. The app securely manages OpenAI API keys using python-dotenv and ensures a seamless user experience for engaging with advanced

Notifications You must be signed in to change notification settings

rishisolanke/ChatBot-using-gpt-3.5-turbo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version app_file pinned
Rushis QA Chatbot
📊
gray
green
streamlit
1.36.0
app.py
false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Langchain Q&A Demo

Overview

Langchain Q&A Demo is a web application that leverages Langchain and OpenAI's GPT-3.5-turbo model to provide interactive question-and-answer capabilities. Built using Streamlit, this app allows users to input questions and receive responses generated by the powerful OpenAI language model.

Features

  • Interactive Q&A: Users can input questions and get responses generated by OpenAI's GPT-3.5-turbo model.
  • Streamlit Integration: Simple and user-friendly web interface for seamless interaction.
  • Environment Variable Management: Securely manage API keys using the python-dotenv package.

Installation

Prerequisites

  • Python 3.6 or higher
  • pip (Python package installer)
  • OpenAI API key

Steps

  1. Clone the Repository:

    git clone https://github.com/yourusername/langchain-qa-demo.git
    cd langchain-qa-demo
  2. Create a Virtual Environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install Dependencies: The application automatically installs required packages if they are not already installed:

    python main.py
  4. Set Up Environment Variables: Create a .env file in the project root directory and add your OpenAI API key:

    OPEN_API_KEY=your_openai_api_key

Usage

  1. Run the Application:

    streamlit run main.py
  2. Interact with the Application:

    • Open your web browser and navigate to http://localhost:8501.
    • Input your question in the provided text box and click "Ask the question".
    • The response generated by the OpenAI model will be displayed on the page.

Code Explanation

install Function

This function installs the required packages if they are not already installed:

def install(package):
    subprocess.check_call([sys.executable, "-m", "pip", "install", package])

About

Langchain Q&A Demo is a Streamlit-based web application that uses Langchain and OpenAI’s GPT-3.5-turbo to provide interactive question-and-answer functionality. Users can input questions and receive AI-generated responses. The app securely manages OpenAI API keys using python-dotenv and ensures a seamless user experience for engaging with advanced

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages