import streamlit as st import time st.set_page_config( page_title="Chatbot Streamlit", page_icon="🤖", layout="wide" ) st.markdown(""" """, unsafe_allow_html=True) with st.sidebar: st.title("⚙️ Painel") st.write("Chatbot em Streamlit") if st.button("🗑️ Nova conversa", use_container_width=True): st.session_state.messages = [ {"role": "assistant", "content": "Olá! Sou o teu chatbot em Streamlit. Como te posso ajudar?"} ] st.rerun() st.info("Podes ligar isto depois a uma API, modelo local ou Hugging Face.") st.markdown("
VersĂŁo com visual melhorado e histĂłrico de conversa
", unsafe_allow_html=True) if "messages" not in st.session_state: st.session_state.messages = [ {"role": "assistant", "content": "Olá! Sou o teu chatbot em Streamlit. Como te posso ajudar?"} ] for msg in st.session_state.messages: css_class = "user-bubble" if msg["role"] == "user" else "bot-bubble" st.markdown(f"