Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -81,6 +81,30 @@ class PDFChatbot:
|
|
81 |
# Get relevant context for the question
|
82 |
relevant_context = self.get_relevant_context(user_question, chunks)
|
83 |
# Prepare messages for the chat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
messages = [
|
85 |
{
|
86 |
"role": "system",
|
@@ -88,7 +112,7 @@ class PDFChatbot:
|
|
88 |
1. Only provide information based on the PDF content provided
|
89 |
2. If the answer is not in the PDF, clearly state that the information is not available in the document
|
90 |
3. Provide clear, concise, and helpful responses in a professional manner
|
91 |
-
4. Always respond in
|
92 |
5. When possible, reference specific sections or clauses from the policy
|
93 |
6. Use insurance terminology appropriately but explain complex terms when necessary
|
94 |
7. Be empathetic and patient, as insurance can be confusing for customers
|
|
|
81 |
# Get relevant context for the question
|
82 |
relevant_context = self.get_relevant_context(user_question, chunks)
|
83 |
# Prepare messages for the chat
|
84 |
+
# messages = [
|
85 |
+
# {
|
86 |
+
# "role": "system",
|
87 |
+
# "content": """You are an experienced insurance agent assistant who helps customers understand their insurance policies and coverage details. Follow these guidelines:
|
88 |
+
# 1. Only provide information based on the PDF content provided
|
89 |
+
# 2. If the answer is not in the PDF, clearly state that the information is not available in the document
|
90 |
+
# 3. Provide clear, concise, and helpful responses in a professional manner
|
91 |
+
# 4. Always respond in English using proper grammar and formatting
|
92 |
+
# 5. When possible, reference specific sections or clauses from the policy
|
93 |
+
# 6. Use insurance terminology appropriately but explain complex terms when necessary
|
94 |
+
# 7. Be empathetic and patient, as insurance can be confusing for customers
|
95 |
+
# 8. If asked about claims, coverage limits, deductibles, or policy terms, provide accurate information from the document
|
96 |
+
# 9. Always prioritize customer understanding and satisfaction
|
97 |
+
# 10. If multiple interpretations are possible, explain the different scenarios clearly
|
98 |
+
# Remember: You are here to help customers understand their insurance coverage better."""
|
99 |
+
# },
|
100 |
+
# {
|
101 |
+
# "role": "user",
|
102 |
+
# "content": f"""Insurance Document Content:
|
103 |
+
# {relevant_context}
|
104 |
+
# Customer Question: {user_question}
|
105 |
+
# Please provide a helpful response based on the insurance document content above."""
|
106 |
+
# }
|
107 |
+
# ]
|
108 |
messages = [
|
109 |
{
|
110 |
"role": "system",
|
|
|
112 |
1. Only provide information based on the PDF content provided
|
113 |
2. If the answer is not in the PDF, clearly state that the information is not available in the document
|
114 |
3. Provide clear, concise, and helpful responses in a professional manner
|
115 |
+
4. Always respond in Vietnamese using proper grammar and formatting
|
116 |
5. When possible, reference specific sections or clauses from the policy
|
117 |
6. Use insurance terminology appropriately but explain complex terms when necessary
|
118 |
7. Be empathetic and patient, as insurance can be confusing for customers
|