KhantKyaw commited on
Commit
10bdb16
·
verified ·
1 Parent(s): 93e9f31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -59,23 +59,23 @@ st.title("Simple Chatbot")
59
 
60
  # Initialize session state to store chat history
61
  if 'chat_history' not in st.session_state:
62
- st.session_state.chat_history = []
63
 
64
  # Chat input
65
- user_input = st.chat_input("You", key="chat_input")
66
 
67
  # Check if there is an input
68
  if user_input:
69
  # Generate a response based on the user input
70
- response = generate_response(user_input)
71
 
72
  # Update chat history with the user input and bot response
73
- st.session_state.chat_history.append(("You", user_input))
74
- st.session_state.chat_history.append(("Bot", response))
75
 
76
  # Display chat history
77
- for author, text in st.session_state.chat_history:
78
- st.chat_message(text=text, author=author)
79
 
80
 
81
 
 
59
 
60
  # Initialize session state to store chat history
61
  if 'chat_history' not in st.session_state:
62
+ st.session_state.chat_history = []
63
 
64
  # Chat input
65
+ user_input = st.chat_input(placeholder="Say Something!", key="chat_input")
66
 
67
  # Check if there is an input
68
  if user_input:
69
  # Generate a response based on the user input
70
+ response = generate_response(user_input)
71
 
72
  # Update chat history with the user input and bot response
73
+ st.session_state.chat_history.append(("You", user_input))
74
+ st.session_state.chat_history.append(("Bot", response))
75
 
76
  # Display chat history
77
+ for author, text in st.session_state.chat_history:
78
+ st.chat_message(text=text, author=author)
79
 
80
 
81