Skip to content

This repository contains a simple but powerful chatbot built with Streamlit, OpenAI, and LangChain. The chatbot maintains conversational memory, meaning it can reference past exchanges in its responses.

Notifications You must be signed in to change notification settings

AustonianAI/chatbot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatBot Starter with Streamlit, OpenAI, and LangChain

This repository contains a simple yet powerful chatbot built with Streamlit, OpenAI, and LangChain. The chatbot maintains conversational memory, meaning it can reference past exchanges in its responses.

Overview

The chatbot is a demonstration of integrating OpenAI's GPT model, the LangChain library, and Streamlit for creating interactive web applications. The bot's conversational memory allows it to maintain context during the chat session, leading to a more coherent and engaging user experience. Importantly, this feature-rich chatbot application is implemented in less than 40 lines of code (excluding whitespace and comments)!

Key Features

  • Streamlit: A powerful, fast Python framework used to create the web interface for the chatbot.
  • OpenAI's GPT: A state-of-the-art language processing AI model that generates the chatbot's responses.
  • LangChain: A wrapper library for the ChatGPT model that helps manage conversation history and structure the model's responses.

Demo App

Streamlit App

How to Run

Prerequisites

  • Python 3.6 or higher
  • Streamlit
  • LangChain
  • OpenAI API key

Steps

  1. Clone this repository.
  2. Install the necessary Python packages using the command pip install -r requirements.txt.
  3. Set the environment variable for your OpenAI API key.
  4. Run the Streamlit app using the command streamlit run streamlit_app.py.

Usage

The chatbot starts with a system message that sets the tone for the conversation. It then alternates between receiving user inputs and generating AI responses. The conversation history is stored and used as context for generating future responses, allowing the chatbot to maintain conversational continuity.

Contribution

Contributions, issues, and feature requests are welcome. Feel free to check the Issues page if you want to contribute.

License

This project is licensed under the terms of the MIT license.

About

This repository contains a simple but powerful chatbot built with Streamlit, OpenAI, and LangChain. The chatbot maintains conversational memory, meaning it can reference past exchanges in its responses.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages