Update app.py
Browse files
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 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
|
|
|
|
161 |
},
|
162 |
-
|
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()])
|