Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -184,26 +184,22 @@ async def handle_message(message: cl.Message):
|
|
184 |
|
185 |
if response:
|
186 |
try:
|
187 |
-
booking_data = json.loads(response)
|
188 |
table = "| Field | Information |\n|---|---|\n"
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
value = booking_data.get(field, 'N/A')
|
204 |
-
table += f"| {display_name} | {value} |\n"
|
205 |
-
|
206 |
-
|
207 |
await cl.Message(content=table).send()
|
208 |
|
209 |
except Exception as e:
|
|
|
184 |
|
185 |
if response:
|
186 |
try:
|
187 |
+
booking_data = json.loads(response.get("output", "{}"))
|
188 |
table = "| Field | Information |\n|---|---|\n"
|
189 |
+
|
190 |
+
table = f"""
|
191 |
+
| Field | Value |
|
192 |
+
|-------------|--------------------|
|
193 |
+
| Booking ID | {booking_data.get('booking_id', 'N/A')} |
|
194 |
+
| Name | {booking_data.get('full_name', 'N/A')} |
|
195 |
+
| Amount | {booking_data.get('amount', 'N/A')} kr |
|
196 |
+
| Check-in | {booking_data.get('checkin', 'N/A')} |
|
197 |
+
| Check-out | {booking_data.get('checkout', 'N/A')} |
|
198 |
+
| Address | {booking_data.get('address', 'N/A')} |
|
199 |
+
| User ID | {booking_data.get('user_id', 'N/A')} |
|
200 |
+
| Info | {booking_data.get('infotext', 'N/A')} |
|
201 |
+
| Included | {booking_data.get('included', 'N/A')} |
|
202 |
+
"""
|
|
|
|
|
|
|
|
|
203 |
await cl.Message(content=table).send()
|
204 |
|
205 |
except Exception as e:
|