New Component: Streamlit-chat, a new way to create chatbots

Hi, Thanks for the chat interface library.

Currently I am facing issue on how to include media into the bot response as the behaviour of respond I dont quite understand. What I want is to include the image below the bot response, instead it goes outside the chat container

Hi @luqmannur.ai
How did you change the user icon?

message(message, 
            is_user=False, 
            avatar_style="adventurer", # change this for different user icon
            seed=123, # or the seed for different user icons
)

supported styles - https://avatars.dicebear.com/styles

3 Likes

sorry it does not support media :frowning:

How do I change the avatars, if I only have

ā€œfrom streamlit_chat import messageā€

in my streamlit_app.py?

You just have to provide values for the avatar_style and seed parameters (of message() to change the avatarā€¦

Where are ā€˜avatar_styleā€™ and ā€˜seedā€™?

Found avatar_style in message

Now, how do I change the bot avatar?

Is it ImportError?

Thanks Yashppawar, itā€™s resolved now.

Any update on when hitting ā€˜enterā€™, then it clears the input box?
And any update on better workaround for having the chatbox at the bottom of the page. Someone previously mentioned theyā€™re working on it.

Thank you so much for this amazing component. I love it!!!

2 Likes

Hi, still no support for ā€˜\nā€™ and html ?
can you help me to solve this problemā€¦ :face_exhaling:

1 Like

Great component, I made my chatbot with Streamlit-Chat, openAI, GPT-3. Link https://lamisghoualmi-lamis-chatbot-chatbotmain-rrztp4.streamlit.app/

1 Like

sorry for very late reply, but I believe you are looking for ā€˜<br>ā€™ in tag HTML (break, which adds a new line)

Thank you very much @LamisGhoualmi00 !!

@yashppawar, could you provide an example for the syntax to get a line break inside of a message? iā€™ve tried \n, <br> (including wrapping a tags around it) but nothing seems to work. The
tags just display in-line and \n seem to just be ignored. Is there some escape char needed?

@yashppawar I meet the same question about new line in message :rofl:

sorry @Max and @jincandeng, I checked it and it does not support a new line, react disables all the HTML tags inside the textā€¦ :frowning:

Hi @yashppawar , anyway I can let user edit the response generated by the chat? Looking for some testing, but it doesnā€™t support editing and user feedback. Any suggestion? I tried the edit button etc but not working.

Hi @yashppawar is there a way I can edit the chat avatars and the placement of text box?