Spaces:
Sleeping
Sleeping
import streamlit as st | |
def main(): | |
st.title("Health Chatbot") | |
st.set_page_config(page_title="Health Chatbot", page_icon="π§", layout="wide") | |
if 'messages' not in st.session_state: | |
st.session_state.messages = [] | |
# display all the messages already in the session state | |
for message in st.session_state.messages: | |
if message["sender"] == "user": | |
st.write("You: ", message["message"]) | |
else: | |
st.write("Bot: ", message["message"]) | |
user_input = st.chat_input("You", key="user_input") | |
if user_input: | |
st.session_state.messages.append({"sender": "user", "message": user_input}) | |
if __name__ == "__main__": | |
main() |