camparchimedes commited on
Commit
45b92d7
ยท
verified ยท
1 Parent(s): 9871c29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -36,7 +36,7 @@ Question: {question}
36
  Answer:
37
  """
38
  daysoff_assistant_prompt = PromptTemplate(
39
- input_variables=['chat_history', 'question'],
40
  template=daysoff_assistant_template
41
  )
42
 
@@ -115,7 +115,7 @@ async def handle_message(message: cl.Message):
115
 
116
 
117
  if re.search(booking_pattern, user_message):
118
- bestillingskode = re.search(booking_pattern, user_message)#.group(0)
119
  question = f"Retrieve information for booking ID {base_url}?search={bestillingskode}"
120
 
121
  response = await api_chain.acall(
@@ -127,7 +127,19 @@ async def handle_message(message: cl.Message):
127
  callbacks=[cl.AsyncLangchainCallbackHandler()])
128
 
129
  else:
130
- response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
  response_key = "output" if "output" in response else "text"
133
  await cl.Message(response.get(response_key, "")).send()
 
36
  Answer:
37
  """
38
  daysoff_assistant_prompt = PromptTemplate(
39
+ input_variables=['chat_history', 'help1', 'question', 'utleiere_faq_data', 'personvernspolicy_data', 'ansatte_faq_data'],
40
  template=daysoff_assistant_template
41
  )
42
 
 
115
 
116
 
117
  if re.search(booking_pattern, user_message):
118
+ bestillingskode = re.search(booking_pattern, user_message).group(0)
119
  question = f"Retrieve information for booking ID {base_url}?search={bestillingskode}"
120
 
121
  response = await api_chain.acall(
 
127
  callbacks=[cl.AsyncLangchainCallbackHandler()])
128
 
129
  else:
130
+ response = await llm_chain.acall(
131
+ {
132
+ 'chat_history': chat_history,
133
+ 'question': user_message,
134
+ 'help1': help1(), # --call function w/arguments to get the instruction
135
+ 'ansatte_faq_data': ansatte_faq_data,
136
+ 'utleiere_faq_data': utleiere_faq_data,
137
+ 'personvernspolicy_data': personvernspolicy_data,
138
+ 'help2': help2()
139
+ },
140
+ callbacks=[cl.AsyncLangchainCallbackHandler()])
141
+
142
+ #response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
143
 
144
  response_key = "output" if "output" in response else "text"
145
  await cl.Message(response.get(response_key, "")).send()