Spaces:
Sleeping
Sleeping
Gopikanth123
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -67,29 +67,23 @@ def data_ingestion_from_directory():
|
|
67 |
index.storage_context.persist(persist_dir=PERSIST_DIR)
|
68 |
|
69 |
def handle_query(query):
|
70 |
-
chat_text_qa_msgs = [
|
71 |
-
(
|
72 |
-
"user",
|
73 |
-
"""
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
Language-Specific Guidance:
|
87 |
-
- For English: Respond in English.
|
88 |
-
- For Telugu: తెలుగు లో సమాధానం ఇవ్వండి.
|
89 |
-
- For Hindi: हिंदी में उत्तर दें.
|
90 |
-
"""
|
91 |
-
)
|
92 |
]
|
|
|
93 |
|
94 |
text_qa_template = ChatPromptTemplate.from_messages(chat_text_qa_msgs)
|
95 |
|
|
|
67 |
index.storage_context.persist(persist_dir=PERSIST_DIR)
|
68 |
|
69 |
def handle_query(query):
|
70 |
+
chat_text_qa_msgs = [
|
71 |
+
(
|
72 |
+
"user",
|
73 |
+
"""You are the Taj Hotel chatbot, Taj Hotel Helper.
|
74 |
+
Respond professionally and concisely in the user's preferred language.
|
75 |
+
Prioritize accuracy and refer only to your context. If unsure, admit it gracefully.
|
76 |
+
|
77 |
+
Context: {context_str}
|
78 |
+
User's Question: {query_str}
|
79 |
+
|
80 |
+
Reply Rules:
|
81 |
+
- Be concise: 10-15 words per answer.
|
82 |
+
- Match the language: English, Telugu, or Hindi.
|
83 |
+
"""
|
84 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
]
|
86 |
+
|
87 |
|
88 |
text_qa_template = ChatPromptTemplate.from_messages(chat_text_qa_msgs)
|
89 |
|