No project description provided
Project description
streamlit-chitchat
make chat messages easier to style in streamlit
streamlit-chitchat lets you style messages from the user and responses from a bot differently. you can also update an existing message, so that streamed tokens render as they are received.
Installation
Open a terminal and run:
$ pip install streamlit-chitchat
example use
in your streamlit app, insert:
from streamlit-chitchat.chitchat import message
message('hello, how are you?', is_user=True)
bot=message()
for w in 'excellent! have any plans for tonight?'.split(' '):
bot.write(w+' ')
example styling
use an avatar:
message('hello, how are you?', is_user=True, avatar='images/test.png')
you can also use image urls, svg code or svg files
set background color:
message('hello, how are you?', is_user=True, background='rgb(150,160,150)')
In order to make the color lighter, you can use rgb with alpha value: background='rgb(130,120,100, 0.5)'
set font size:
message('hello, how are you?', is_user=True, font_size='1rem')
other values
font color, width , or margin
message('hello', color='rgb(20,20,30)', width='70%', margin='5px')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for streamlit_chitchat-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53a898fabc6319fd4623b4455611b455056c6c4029cc676e34a42ae81ee07636 |
|
MD5 | 5b1436cf72a85df29fcf7d3127925861 |
|
BLAKE2b-256 | 3db8d9930fb46255dc95220f2cc266bbcc7a5f22bb011b155f9e93950bd240d4 |