camparchimedes commited on
Commit
8e5aa55
ยท
verified ยท
1 Parent(s): 2892106

Update api_data.py

Browse files
Files changed (1) hide show
  1. api_data.py +13 -14
api_data.py CHANGED
@@ -121,22 +121,21 @@ async def booking_agent_system(message: cl.Message, msg: cl.Message) -> bool:
121
  #for token in combined_message.split():
122
  #await msg.stream_token(token + " ")
123
 
124
- table = (
125
- "------------------------------\n"
126
- f"Bestillingskode: {booking_data.get('booking_id', 'N/A')}\n"
127
- f"Full Name: {booking_data.get('full_name', 'N/A')}\n"
128
- f"Amount: {booking_data.get('amount', 0)} kr\n"
129
- f"Check-in: {booking_data.get('checkin', 'N/A')}\n"
130
- f"Check-out: {booking_data.get('checkout', 'N/A')}\n"
131
- f"Address: {booking_data.get('address', 'N/A')}\n"
132
- f"User ID: {booking_data.get('user_id', 0)}\n"
133
- f"Info Text: {booking_data.get('infotext', 'N/A')}\n"
134
- f"Included: {booking_data.get('included', 'N/A')}\n"
 
135
  )
136
  #combined_message = f"### Informasjon for bestilling:\n\n{table}"
137
- #await cl.Message(content=combined_message).send()
138
- combined_message = f"### Informasjon for bestilling:\n\n{table}"
139
- for token in combined_message.split():
140
  await msg.stream_token(token + " ")
141
 
142
  except (APIConnectionError, APIResponseError, BookingNotFoundError) as e:
 
121
  #for token in combined_message.split():
122
  #await msg.stream_token(token + " ")
123
 
124
+ markdown_table = (
125
+ "| ๐‘ญ๐’Š๐’†๐’๐’… | ๐—œ๐—ป๐—ณ๐—ผ |\n"
126
+ "|:-----------|:---------------------|\n"
127
+ f"| ๐™ฑ๐šŽ๐šœ๐š๐š’๐š•๐š•๐š’๐š—๐š๐šœ๐š”๐š˜๐š๐šŽ | {booking_data.get('booking_id', 'N/A')} |\n"
128
+ f"| ๐™๐™ช๐™ก๐™ก ๐™‰๐™–๐™ข๐™š | {booking_data.get('full_name', 'N/A')} |\n"
129
+ f"| ๐˜ผ๐™ข๐™ค๐™ช๐™ฃ๐™ฉ | {booking_data.get('amount', 0)} kr |\n"
130
+ f"| ๐˜พ๐™๐™š๐™˜๐™ -๐™ž๐™ฃ | {booking_data.get('checkin', 'N/A')} |\n"
131
+ f"| ๐˜พ๐™๐™š๐™˜๐™ -๐™ค๐™ช๐™ฉ | {booking_data.get('checkout', 'N/A')} |\n"
132
+ f"| ๐˜ผ๐™™๐™™๐™ง๐™š๐™จ๐™จ | {booking_data.get('address', 'N/A')} |\n"
133
+ f"| ๐™๐™จ๐™š๐™ง ๐™„๐˜ฟ | {booking_data.get('user_id', 0)} |\n"
134
+ f"| ๐™„๐™ฃ๐™›๐™ค ๐™๐™š๐™ญ๐™ฉ | {booking_data.get('infotext', 'N/A')} |\n"
135
+ f"| ๐™„๐™ฃ๐™˜๐™ก๐™ช๐™™๐™š๐™™ | {booking_data.get('included', 'N/A')} |"
136
  )
137
  #combined_message = f"### Informasjon for bestilling:\n\n{table}"
138
+ for token in markdown_table.split():
 
 
139
  await msg.stream_token(token + " ")
140
 
141
  except (APIConnectionError, APIResponseError, BookingNotFoundError) as e: