👋 Welcome to the General Knowledge Assistant!
Ask me anything about general knowledge, facts, or concepts.
I can search the web when needed to provide you with up-to-date information.
""", unsafe_allow_html=True)
else:
# Display all messages
for msg in st.session_state.messages:
# Ensure we're handling the message correctly based on its type
if isinstance(msg, dict) and "role" in msg and "content" in msg:
with st.chat_message(msg["role"]):
st.write(msg["content"])
else:
st.error(f"Invalid message format: {msg}")
if __name__ == "__main__":
main()