camparchimedes commited on
Commit
a99d2ea
·
verified ·
1 Parent(s): a50de36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -145,24 +145,24 @@ async def handle_message(message: cl.Message):
145
 
146
  # --POST method, booking_id@body
147
  if re.search(booking_pattern, user_message):
148
- bestillingskode = re.search(booking_pattern, user_message).group(0)
149
- question = f"Retrieve information for booking ID {bestillingskode}"
150
-
151
- response = await api_chain.acall(
152
- {
153
- "url": endpoint_url,
154
- "method": "POST",
155
- "headers": {
156
- "Authorization": f"Bearer {auth_token}",
157
- "Content-Type": "application/json"
158
- },
159
- "body": {
160
- "booking_id": bestillingskode
 
 
161
  },
162
- "question": question
163
- },
164
- callbacks=[cl.AsyncLangchainCallbackHandler()]
165
- )
166
 
167
  else:
168
  response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
 
145
 
146
  # --POST method, booking_id@body
147
  if re.search(booking_pattern, user_message):
148
+ bestillingskode = re.search(booking_pattern, user_message).group(0)
149
+ question = f"Retrieve information for booking ID {bestillingskode}"
150
+
151
+ response = await api_chain.acall(
152
+ {
153
+ "url": endpoint_url,
154
+ "method": "POST",
155
+ "headers": {
156
+ "Authorization": f"Bearer {auth_token}",
157
+ "Content-Type": "application/json"
158
+ },
159
+ "body": {
160
+ "booking_id": bestillingskode
161
+ },
162
+ "question": question
163
  },
164
+ callbacks=[cl.AsyncLangchainCallbackHandler()]
165
+ )
 
 
166
 
167
  else:
168
  response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])