/fastui-chat

💬 minimalistic ChatBot Interface in pure python

Primary LanguagePythonMIT LicenseMIT

fastui-chat

Version Downloads license Twitter Follow

A minimalistic ChatBot Interface in pure python.
Build on top of FastUI and LangChain Core.

Usage

pip install fastui-chat
from langchain.chat_models import ChatOpenAI
from langchain.memory import ChatMessageHistory

from fastui_chat import ChatUI, basic_chat_handler

history = ChatMessageHistory()
handler = basic_chat_handler(
    llm=ChatOpenAI(),
    chat_history=history,
)

history.add_ai_message("How can I help you today?")

app = ChatUI(
    chat_history=history,
    chat_handler=handler,
)

app.start_with_uvicorn()

Features

  • Easy to use
  • Minimalistic & Lightweight
  • LangChain Compatible
  • Python Only

Development Setup

git clone https://github.com/shroominic/fastui-chat.git && cd fastui-chat

./dev-install.sh

TODO

  • Image IO (vision models)

  • Store previous chats and display them

  • AutoScroll to bottom of chat on new message

  • Make easy to deploy

  • Add tests

  • Add more examples

  • ... other ideas? Open an issue or PR!