`streamlit_chat`: how to add custom image as an avatar for bot


I’ve create a config.toml:

enableStaticServing = true

Then using the following code:

    st.session_state["response"][i], key=str(i),
        # also tried: ./app/static/img/chatbot_v2.png
        # also tried: /app/static/img/chatbot_v2.png
        '/static/img/chatbot_v2.png' # This path can show in local develop

However, there’re not found image in cloud app.

How can I solve this? Hope someone can help me.

  • Python version: 3.10
  • Streamlit version: 1.26.0
  • App
  • Github

Please check this it may be helpful to you :-

Thanks so much.

This is work now!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.