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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file streamlit_chitchat-0.1.7.tar.gz.
File metadata
- Download URL: streamlit_chitchat-0.1.7.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e123c9c39870eea80342366e3a2dd75b25e1bf9765cecb535e1a4409d2b2bfce
|
|
| MD5 |
e62c46dd8cc33824eab5caff874adbd2
|
|
| BLAKE2b-256 |
f623c45ac018bea8f91ab8446a49102cacc1318f7aaf7d8a6bd5246ba102543c
|
File details
Details for the file streamlit_chitchat-0.1.7-py3-none-any.whl.
File metadata
- Download URL: streamlit_chitchat-0.1.7-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
203a3a2ad3b5b68c3e97235986ea802b9b4205c15a35a3d318e802df0e759167
|
|
| MD5 |
7aede9c92fedde63e2c0401abc4f5847
|
|
| BLAKE2b-256 |
f812b4ad4861c21754f5643687585574024f8bac39e0999a02330b5b14b3f13d
|