forked from AI-Yash/st-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2552dc6
commit d4c1856
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
3. local media | ||
5. Disable user/bot avatar | ||
4. improve CSS for visual elements | ||
6. Streamline text display | ||
1. Copy to Clipboard | ||
2. container for ChatBox | ||
7. wait for next message (loader) | ||
|
||
import streamlit_chat as stc | ||
|
||
config = { | ||
'bot_avatar': False | 'url' | ('bottts', 80) | ||
} | ||
|
||
cb = stc.ChatBox(**config) | ||
|
||
cb.populate(user_res, bot_res, streamline=True, wait_for_msg=True, bot_first = True) | ||
|
||
# 2 api's | ||
# 1 : user & bot responses in arrays/lists | ||
|
||
u: ['hi', 'i want ice cream', 'bye'] | ||
b: ['hello, how may i help you', 'ice cream is not good'] | ||
|
||
# 2 : single structured array/lists | ||
history: | ||
[ | ||
(stc.USER, 'content', 'text'), | ||
(stc.BOT, 'url', 'image'), | ||
(stc.BOT, 'content', 'html'), | ||
] | ||
|
||
hist = stc.History() | ||
hist.add_bot('content', 'type') | ||
hist.add_user('content', 'type') |