camparchimedes commited on
Commit
e0d1069
·
verified ·
1 Parent(s): ef5280a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -25
app.py CHANGED
@@ -169,33 +169,11 @@ async def handle_message(message: cl.Message):
169
 
170
  )
171
 
172
- if response:
173
 
174
- #await cl.Message(content=str(response)).send()
175
 
176
- try:
177
- # --debug!
178
- print(f"Raw response: {response}")
179
-
180
- booking_data = json.loads(response)
181
-
182
- table = f"""
183
- | Field | Value |
184
- |-------------|--------------------|
185
- | Booking ID | {booking_data.get('booking_id', 'N/A')} |
186
- | Name | {booking_data.get('full_name', 'N/A')} |
187
- | Amount | {booking_data.get('amount', 'N/A')} kr |
188
- | Check-in | {booking_data.get('checkin', 'N/A')} |
189
- | Check-out | {booking_data.get('checkout', 'N/A')} |
190
- | Address | {booking_data.get('address', 'N/A')} |
191
- | User ID | {booking_data.get('user_id', 'N/A')} |
192
- | Info | {booking_data.get('infotext', 'N/A')} |
193
- | Included | {booking_data.get('included', 'N/A')} |
194
- """
195
- await cl.Message(table).send()
196
-
197
- except json.JSONDecodeError:
198
- await cl.Message(content=f"Error: No decode for JSON. Raw response: {response}").send()
199
 
200
 
201
  else:
 
169
 
170
  )
171
 
172
+
173
 
174
+ await cl.Message(content=str(response)).send()
175
 
176
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
 
178
 
179
  else: