Skip to content

Streamlit-based chatbot demo with support for AI/LLM responses, customizable UI, and fast deployment.

License

Notifications You must be signed in to change notification settings

sha-env/streamlit-chatbot-demo

Streamlit Chatbot Demo

This repository provides a Streamlit-based chatbot application with multiple UI options (basic and React). It is a practical starting point for building, customizing, and deploying AI-powered chatbot interfaces using Python. Developers can run it locally or inside Docker for quick experimentation and prototyping.



Purpose of This Repository

  • Explore conversational AI with Streamlit
  • Customize chatbot interfaces with ease
  • Deploy prototypes quickly in a local or containerized environment


Demonstration

Here’s a simple demo of the chatbot logic in action:

# streamlit_app.py

import streamlit as st

# Simple chatbot response function
def chatbot_response(user_input: str) -> str:
    if "hello" in user_input.lower():
        return "Hi there! How can I help you today?"
    elif "bye" in user_input.lower():
        return "Goodbye! Have a great day! 👋"
    else:
        return "I'm just a demo chatbot. Try saying 'hello' or 'bye'."

# Streamlit UI
st.title("Chatbot Demo 🤖")

# Input box
user_input = st.text_input("You:", "")

# Display chatbot response
if user_input:
    response = chatbot_response(user_input)
    st.write(f"**Bot:** {response}")


Features

  • Streamlit-based chatbot UI for fast prototyping
  • Multiple application variants: basic, advanced, and React-integrated
  • Customizable chatbot logic with simple Python functions
  • Optional React tools integration for richer user experience
  • Docker support for containerized deployment
  • Database utility (database_tools.py) for data storage and interaction
  • Clean and modular code structure separating logic and UI


Technologies Used

  • Python 3.x – main programming language
  • Streamlit – for building interactive chatbot UIs
  • React (optional) – for advanced and dynamic frontend integration
  • SQLite / database_tools.py – lightweight database handling
  • Docker – containerized setup and deployment


Project Setup

To set up this project on your local machine:

  1. Clone the repository
    git clone https://github.com/sha-env/streamlit-chatbot-demo.git
  2. Navigate to the project directory
    cd streamlit-chatbot-demo
  3. Install dependencies
    pip install -r requirements.txt


Steps to Run

  1. Start the Streamlit app
    streamlit run streamlit_react_app.py
  2. Open the app in your browser
    http://localhost:8501


License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.



About

Streamlit-based chatbot demo with support for AI/LLM responses, customizable UI, and fast deployment.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project