eagle0504 commited on
Commit
693b54d
Β·
verified Β·
1 Parent(s): 0f5fcdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -17
app.py CHANGED
@@ -73,20 +73,19 @@ bot = ChatBot()
73
  if bot:
74
  st.session_state["bot"] = bot
75
 
76
-
77
- if prompt := st.chat_input("πŸ˜‰ Ask any question or feel free to use the examples provided in the left sidebar."):
78
-
79
- # Display user message in chat message container
80
- st.chat_message("user").markdown(prompt)
81
-
82
- # Add user message to chat history
83
- st.session_state.messages.append({"role": "user", "content": prompt})
84
-
85
- # API Call
86
- response = bot.generate_response(prompt)
87
-
88
- # Display assistant response in chat message container
89
- with st.chat_message("assistant"):
90
- st.markdown(response)
91
- # Add assistant response to chat history
92
- st.session_state.messages.append({"role": "assistant", "content": response})
 
73
  if bot:
74
  st.session_state["bot"] = bot
75
 
76
+ if prompt := st.chat_input("πŸ˜‰ Ask any question or feel free to use the examples provided in the left sidebar."):
77
+
78
+ # Display user message in chat message container
79
+ st.chat_message("user").markdown(prompt)
80
+
81
+ # Add user message to chat history
82
+ st.session_state.messages.append({"role": "user", "content": prompt})
83
+
84
+ # API Call
85
+ response = bot.generate_response(prompt)
86
+
87
+ # Display assistant response in chat message container
88
+ with st.chat_message("assistant"):
89
+ st.markdown(response)
90
+ # Add assistant response to chat history
91
+ st.session_state.messages.append({"role": "assistant", "content": response})