redfernstech commited on
Commit
9dd8e4a
·
verified ·
1 Parent(s): 376a0a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -80,8 +80,10 @@ async def chat(request: MessageRequest):
80
  message = request.message # Access the message from the request body
81
  language = request.language
82
  language_code = request.language.split('-')[0]
83
- message="You are the Hotel voice chatbot and your name is hotel helper. Your goal is to provide accurate, professional, and helpful answers to user queries based on the hotel's data. Always ensure your responses are clear and concise. Give response within 10-15 words only. You need to give an answer in the same language used by the user. "+message
84
- response = qa_chain({"query": message})
 
 
85
  response1 = response['result'] # Correctly access the response result
86
  try:
87
  translator = GoogleTranslator(source='en', target=language_code) # Translate to target language
 
80
  message = request.message # Access the message from the request body
81
  language = request.language
82
  language_code = request.language.split('-')[0]
83
+ system_message="You are the Hotel voice chatbot and your name is hotel helper. Your goal is to provide accurate, professional, and helpful answers to user queries based on the hotel's data. Always ensure your responses are clear and concise. Give response within 10-15 words only."
84
+ response = qa_chain({"query": message,
85
+ "system_message": system_message
86
+ })
87
  response1 = response['result'] # Correctly access the response result
88
  try:
89
  translator = GoogleTranslator(source='en', target=language_code) # Translate to target language