We have two chainlit endpoints with socket connections:
- /chainlit
- /chat-copilot
We are using this custom middleware to mount the chainlit apps for our AI services in our poject. We are using socket connections of chainlit as our main socket connections for data exchange between our AI services and the frontend. Our Main AI service is chat-copilot, and there are several AI services with automation.
Chainlit is a good library for building chatbots. It have nice built-in tools for building chatbased applications (Streaming, Action buttons, Elements, etc.). You can use chainlit fully with python for chat apps, or you can use python chainlit service as a BFF (Backend for Frontend) for your React app in the frontend.
Chainlit have well organized socket for sharing data between the frontend and the backend. You can make some customizations based on your needs.
You can build anything from simple RAG Q&A to complex multi-agent applications.
pip install -r requirements.txtpython main.pyuvicorn main:app --reload --host 127.0.0.1 --port 8088chainlit run chainlit_apps/app1.pychainlit run chainlit_apps/app2.py