ngcanh commited on
Commit
c08a9b1
·
verified ·
1 Parent(s): c43245f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -97,11 +97,7 @@ def rag_query(query):
97
  messages = [
98
  {
99
  "role": "user",
100
- "content": f"""Bạn là một chuyên viên tư vấn cho khách hàng về sản phẩm bảo hiểm của công ty MB Ageas Life tại Việt Nam.
101
- Hãy trả lời chuyên nghiệp, chính xác, cung cấp thông tin trước rồi hỏi câu tiếp theo.
102
- Tất cả các thông tin cung cấp đều trong phạm vi MBAL.
103
- Khi có đủ thông tin khách hàng thì mới mời khách hàng đăng ký để nhận tư vấn trên https://www.mbageas.life/
104
-
105
  {context_with_memory}
106
  Câu hỏi: {query}
107
  Trả lời:"""
@@ -121,7 +117,7 @@ def process_feedback(query, response, feedback):
121
  else:
122
  # If thumbs down, remove the response from memory buffer and regenerate the response
123
  # memory.chat_memory.messages = [msg for msg in memory.chat_memory.messages if msg.get("content") != response]
124
- new_query=f"{query}. Give better response"
125
  new_response = rag_query(new_query)
126
  st.markdown(new_response)
127
  memory.chat_memory.add_ai_message(new_response)
 
97
  messages = [
98
  {
99
  "role": "user",
100
+ "content": f"""Bạn là một chuyên viên tư vấn cho khách hàng về sản phẩm bảo hiểm của công ty MB Ageas Life tại Việt Nam. Hãy trả lời chuyên nghiệp, chính xác. Tất cả các thông tin cung cấp đều trong phạm vi MBAL. Mời khách hàng đăng ký để nhận tư vấn kỹ hơn trên https://www.mbageas.life/
 
 
 
 
101
  {context_with_memory}
102
  Câu hỏi: {query}
103
  Trả lời:"""
 
117
  else:
118
  # If thumbs down, remove the response from memory buffer and regenerate the response
119
  # memory.chat_memory.messages = [msg for msg in memory.chat_memory.messages if msg.get("content") != response]
120
+ new_query=f"{query}. Tạo câu trả lời đúng với câu hỏi"
121
  new_response = rag_query(new_query)
122
  st.markdown(new_response)
123
  memory.chat_memory.add_ai_message(new_response)