Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -153,24 +153,27 @@ async def handle_message(message: cl.Message):
|
|
153 |
|
154 |
},
|
155 |
callbacks=[cl.AsyncLangchainCallbackHandler()])
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
174 |
response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
|
175 |
|
176 |
response_key = "output" if "output" in response else "text"
|
|
|
153 |
|
154 |
},
|
155 |
callbacks=[cl.AsyncLangchainCallbackHandler()])
|
156 |
+
|
157 |
+
booking_info = response.get("output", {}) # json.loads(response.get("output", "{}"))
|
158 |
+
|
159 |
+
formatted_response = f"""
|
160 |
+
Her er informasjon for bestillingskode: {bestillingskode}
|
161 |
+
|
162 |
+
| Felt | Detaljer |
|
163 |
+
|-------------|----------------------------------------|
|
164 |
+
| Navn: | {booking_info.get('Navn', 'N/A')} |
|
165 |
+
| Belรธp: | {booking_info.get('Belรธp', 'N/A')} NOK |
|
166 |
+
| Check-In: | {booking_info.get('Checkin', 'N/A')} |
|
167 |
+
| Check-Out: | {booking_info.get('Checkout', 'N/A')} |
|
168 |
+
| Addresse: | {booking_info.get('Addresse', 'N/A')} |
|
169 |
+
| Bruker ID: | {booking_info.get('Bruker ID', 'N/A')} |
|
170 |
+
| Viktig informasjon: | {booking_info.get('Viktig informasjon', 'N/A')} |
|
171 |
+
| Message: | {booking_info.get('Message', 'N/A')} |
|
172 |
+
"""
|
173 |
+
|
174 |
+
await cl.Message(content=formatted_response).send()
|
175 |
+
|
176 |
+
else:
|
177 |
response = await llm_chain.acall(user_message, callbacks=[cl.AsyncLangchainCallbackHandler()])
|
178 |
|
179 |
response_key = "output" if "output" in response else "text"
|