Spaces:
Running
Running
Update app.py
Browse files
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
|
| 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("
|
| 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"**
|
| 151 |
-
st.markdown(f"**
|
| 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:")
|