A chat box used in streamlit
Project description
Chatbox component for streamlit
A Streamlit component to show chat messages.
Features
- user can custom the bg_color and icon of message senders.
- support streaming output.
This make it easy to chat with LLMs in streamlit.
Install
just pip install streamlit-chatbox
Usage examples
import streamlit as st
from streamlit_chatbox import st_chatbox
import time
st.write('start to chat')
streaming = st.checkbox('streaming', False)
chat_box = st_chatbox(
greetings=['welcome to chat', '\n```streamlit``` is a great tool!'])
q = st.text_input('input', placeholder='input your question here')
if q:
chat_box.user_say(q)
text = f'my answer to:\n\n{q}\n\n```this is some code```'
if streaming:
chat_box.robot_stream(text)
else:
chat_box.robot_say(text)
chat_box.output_messages()
use help(st_chatbox)
to see more custom params.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for streamlit_chatbox-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a0c24573f2e5eb35f23876855ce30d4f68c38f606e8465b11be78837d5515c |
|
MD5 | e765f0c0ffd71caea891af7fbb427390 |
|
BLAKE2b-256 | d91cf872ad2625a46f1322314b787f281848f525f6a34380d10c840c72f1ddaa |