ngcanh commited on
Commit
9d4021b
·
verified ·
1 Parent(s): cc17a84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -113,7 +113,7 @@ Please provide a helpful response based on the insurance document content above.
113
  return bot_response
114
 
115
  def main():
116
- st.set_page_config(page_title="Chatbot tư vấn của công ty bảo hiểm nhân thọ MB Ageas Life", page_icon="🛡️", layout="wide")
117
  st.title("🛡️ Chatbot tư vấn bảo hiểm của công ty bảo hiểm nhân thọ MB Ageas Life")
118
  # Initialize chatbot
119
  if 'chatbot' not in st.session_state:
@@ -138,7 +138,7 @@ def main():
138
  # Chat input
139
  user_question = st.chat_input("Hãy đặt những câu hỏi về hợp đồng bảo hiểm cơ bản...")
140
  if user_question:
141
- with st.spinner("Analyzing your policy..."):
142
  # Get response from chatbot
143
  response = st.session_state.chatbot.chat_with_pdf(
144
  user_question,
@@ -147,8 +147,8 @@ def main():
147
  # Add to chat history
148
  st.session_state.chat_history.append((user_question, response))
149
  # Display the new response
150
- st.markdown(f"**You:** {user_question}")
151
- st.markdown(f"**Insurance Assistant:** {response}")
152
  else:
153
  # Show example questions
154
  st.subheader("Các câu hỏi bạn có thể hỏi:")
 
113
  return bot_response
114
 
115
  def main():
116
+ st.set_page_config(page_title="Chatbot MB Ageas Life", page_icon="🛡️", layout="wide")
117
  st.title("🛡️ Chatbot tư vấn bảo hiểm của công ty bảo hiểm nhân thọ MB Ageas Life")
118
  # Initialize chatbot
119
  if 'chatbot' not in st.session_state:
 
138
  # Chat input
139
  user_question = st.chat_input("Hãy đặt những câu hỏi về hợp đồng bảo hiểm cơ bản...")
140
  if user_question:
141
+ with st.spinner("Đang đưa ra câu trả lời..."):
142
  # Get response from chatbot
143
  response = st.session_state.chatbot.chat_with_pdf(
144
  user_question,
 
147
  # Add to chat history
148
  st.session_state.chat_history.append((user_question, response))
149
  # Display the new response
150
+ st.markdown(f"**Câu hỏi:** {user_question}")
151
+ st.markdown(f"**Trợ lý bảo hiểm:** {response}")
152
  else:
153
  # Show example questions
154
  st.subheader("Các câu hỏi bạn có thể hỏi:")