camparchimedes commited on
Commit
3f8539b
·
verified ·
1 Parent(s): 151cbbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -10
app.py CHANGED
@@ -64,15 +64,19 @@ PERSONVERNSPOLICY_QUESTIONS = [
64
 
65
  # If you do not know the answer, just reply truthfully that you do not have the answer rather than
66
  # giving inaccurate or speculative information.
 
 
 
 
 
67
  daysoff_assistant_template = """
68
- You are a customer support assistant (’kundeservice AI assistent’) for Daysoff.no.
69
  By default, you respond in Norwegian language, using a warm, direct, and professional tone.
70
  Your expertise is exclusively in providing information and assistance related to
71
- (i) retrieving booking information for a given booking ID,
72
- (ii) answering frequently asked questions (FAQ) about DaysOff firmahytteordning for employees and employers,
73
- (iii) addressing questions related to Daysoff's personvernspolicy.
74
- You do not provide information outside of this scope. If a question is not about these topics, respond with,
75
- "Jeg spesialiserer meg kun på spørsmål relatert til firmahytteordning, bestillingsinformasjon og personvernspolicy for Daysoff.no."
76
  Chat History: {chat_history}
77
  Question: {question}
78
  Answer:
@@ -172,12 +176,12 @@ async def handle_message(message: cl.Message):
172
  },
173
  callbacks=[cl.AsyncLangchainCallbackHandler()])
174
 
175
- if any(keyword in user_message for keyword in (FAQ_ANSATTE + FAQ_UTLEIERE + PERSONVERNSPOLICY_QUESTIONS)):
176
  #elif any(keyword in user_message for keyword in faq_keywords):
177
- response = await api_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
178
 
179
- else:
180
- response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
181
 
182
  else:
183
  response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
 
64
 
65
  # If you do not know the answer, just reply truthfully that you do not have the answer rather than
66
  # giving inaccurate or speculative information.
67
+
68
+ #(i) retrieving booking information for a given booking ID,
69
+ #(ii) answering frequently asked questions (FAQ) about DaysOff firmahytteordning for employees and employers,
70
+ #(iii) addressing questions related to Daysoff's personvernspolicy.
71
+
72
  daysoff_assistant_template = """
73
+ You are a customer support assistant (’kundeservice AI assistent’) for Daysoff.
74
  By default, you respond in Norwegian language, using a warm, direct, and professional tone.
75
  Your expertise is exclusively in providing information and assistance related to
76
+ booking information for a given booking ID.
77
+ You do not provide information outside of this scope. If a question is not about this topic, respond with
78
+ "Jeg driver kun med henvendelser relatert til bestillingsinformasjon. Gjelder det andre henvendelser,
79
+ kan du kontakte kundeservice kundeservice@daysoff.no"
 
80
  Chat History: {chat_history}
81
  Question: {question}
82
  Answer:
 
176
  },
177
  callbacks=[cl.AsyncLangchainCallbackHandler()])
178
 
179
+ #if any(keyword in user_message for keyword in (FAQ_ANSATTE + FAQ_UTLEIERE + PERSONVERNSPOLICY_QUESTIONS)):
180
  #elif any(keyword in user_message for keyword in faq_keywords):
181
+ #response = await api_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
182
 
183
+ #else:
184
+ #response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
185
 
186
  else:
187
  response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])