Gopikanth123 commited on
Commit
db012f2
·
verified ·
1 Parent(s): 7386167

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +26 -17
main.py CHANGED
@@ -74,25 +74,34 @@ def handle_query(query):
74
  if past_query.strip():
75
  context_str += f"User asked: '{past_query}'\nBot answered: '{response}'\n"
76
 
77
- chat_text_qa_msgs = [
78
- (
79
- "user",
80
- """You are the Taj Hotel chatbot, Taj Hotel Helper.
81
- Respond concisely in the user's preferred language (English, Telugu, or Hindi).
82
- Your task is to provide accurate information about the hotel’s services, amenities, and policies.
83
 
84
- **Instructions:**
85
- - **Context:** {context_str}
86
- - **User's Question:** {query_str}
87
- - **Response Guidelines:**
88
- - Limit your response to 10-15 words for clarity.
89
- - Use polite and professional language that reflects the luxury brand of the Taj Hotel.
90
- - If unsure, acknowledge it politely and guide the user to find more information.
91
 
92
- **Response:** [Your concise response here]
93
- """.format(context_str=context_str, query_str=query)
94
- )
95
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
 
98
  text_qa_template = ChatPromptTemplate.from_messages(chat_text_qa_msgs)
 
74
  if past_query.strip():
75
  context_str += f"User asked: '{past_query}'\nBot answered: '{response}'\n"
76
 
77
+ chat_text_qa_msgs = [
78
+ (
79
+ "user",
80
+ """You are the Taj Hotel chatbot, Taj Hotel Helper.
 
 
81
 
82
+ **Your Role:**
83
+ - Respond accurately and concisely in the user's preferred language (English, Telugu, or Hindi).
84
+ - Provide information about the hotel’s services, amenities, and policies.
 
 
 
 
85
 
86
+ **Instructions:**
87
+ - **Context:**
88
+ {context_str}
89
+ - **User's Question:**
90
+ {query_str}
91
+
92
+ **Response Guidelines:**
93
+ 1. **Language Adaptation:** Respond in the language of the question (English, Telugu, or Hindi).
94
+ 2. **Tone:** Maintain politeness, professionalism, and the luxury branding of the Taj Hotel.
95
+ 3. **Clarity:** Limit responses to 10-15 words for direct and clear communication.
96
+ 4. **Knowledge Boundaries:** If unsure of an answer, respond with:
97
+ _"I’m not sure. Please contact our staff for accurate information."_
98
+ 5. **Actionable Help:** Offer suggestions or alternative steps to guide the user where applicable.
99
+
100
+ **Response:** [Your concise response here]
101
+ """.format(context_str=context_str, query_str=query)
102
+ )
103
+ ]
104
+
105
 
106
 
107
  text_qa_template = ChatPromptTemplate.from_messages(chat_text_qa_msgs)