Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

LangChain + OpenAI GPT-4 Streamlit App

This project is a LangChain-powered AI application built using Python, with a Streamlit frontend and integrated with the OpenAI GPT-4 API.

It allows users to interact with a Large Language Model (LLM) through a simple web interface and receive intelligent, contextual responses.

🚀 Features

🔗 LangChain for prompt management and LLM orchestration

🤖 OpenAI GPT-4 for high-quality language understanding and generation

🖥️ Streamlit frontend for an interactive and user-friendly UI

🧠 Supports contextual prompts and dynamic LLM responses

🔐 Secure API key handling via environment variables

🏗️ Tech Stack

Backend: Python

LLM Framework: LangChain

Model: OpenAI GPT-4

Frontend: Streamlit

API: OpenAI API

📂 Project Structure

.
├── my_app.py              # Streamlit application entry point
├── requirements.txt       # Python dependencies
├── search_app_helper.py   # Chains, Prompt template and helper functions
├── README.md              # Project documentation
└── .env                   # Environment variables

⚙️ Installation

1️⃣ Clone the Repository

git clone https://github.com/kittenbytes00/langchain-openai-streamlit.git

2️⃣ Create a Virtual Environment

source venv/bin/activate   
On Windows: venv\Scripts\activate

3️⃣ Install Dependencies

pip install -r requirements.txt

🔑 Environment Variables

Create a .env file in the project root and add:
OPENAI_API_KEY=your_openai_api_key

⚠️ Do not commit your API key to version control.

▶️ Running the Application

streamlit run my_app.py
The app will be available at:
http://localhost:8501

🧠 How It Works

User enters a prompt in the Streamlit UI
The input is passed to a LangChain chain
LangChain communicates with OpenAI GPT-4
The LLM response is returned and displayed in real-time

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages