Turn a customer's message into the action your bot needs
Reads a chat or voice message into an action and its options: which delivery, which day, week and slot. Code works out the dates; unsure means ask back.
Try it on this example
Customer's latest message, typed or transcribed: Hi, can you move Thursday's delivery to next week? The sofa, not the lamp, the lamp can still come Thursday. Tuesday morning would be best as I'm at work in the afternoons. Also if I'm out when the lamp comes can they leave it with my neighbour at number 14? Thanks
Earlier turns in the conversation, if any: Assistant: Hi, I am the Loftwell Home assistant. How can I help with your order?
Customer's orders and deliveries, each line tagged [D1], [D2]
- Does the request give enough detail to act on without asking a clarifying question?Yes87%
- Which action does the customer ask the assistant to take?Reschedule a delivery100%
- Which delivery in the deliveries list is the message about?D2100%
- Which day does the customer ask for the delivery to move to?Tuesday98%
- Which week does the customer ask for the delivery to move to?Next week100%
- Which delivery slot does the customer ask for?Morning100%
- Does the customer type a calendar date for the delivery they want?No79%
- Does the message ask for more than one separate change or request?Yes97%
- Does the customer express dissatisfaction with our service, charges, decision or conduct?No96%
These are real answers stored from one run on this example.
The prism behind it
Turn a customer's message into the action your bot needs
Fields
- Customer's latest message, typed or transcribed
- Earlier turns in the conversation, if any
- Customer's orders and deliveries, each line tagged [D1], [D2]
Context
Chat and voice assistant of Loftwell Home, an online furniture and homeware retailer that delivers large items with its own two-person crews and small items by parcel courier. These answers turn each customer message into an action and its options for the delivery system; the assistant's reply is written elsewhere. Code lists the customer's orders and deliveries in the deliveries field, one per line, each tagged [D1], [D2] and so on. Code works out every date: it takes the day and week the customer names and today's date and finds the calendar date, and it reads any calendar date the customer types. Code also checks each change against the delivery rules, such as free slots and cut-off times, before the assistant offers it. When an answer is unsure, the assistant asks the customer a short question instead of acting. What the assistant can do: - Track a delivery: say where it is and when it is due. - Reschedule a delivery to another day or slot. - Change delivery instructions: a safe place, a neighbour, access or parking notes. - Change the delivery address before dispatch. - Cancel an order before dispatch. - Start a return. - Record a problem with a delivered item (damaged, missing or wrong item) for the customer care team. Delivery slots: morning 7:00 to 13:00, afternoon 12:00 to 18:00, evening 17:00 to 21:00 (courier parcels only). Complaints, damage claims and anything the assistant cannot do go to the customer care team.
Questions
Does the request give enough detail to act on without asking a clarifying question? Yes / No
Read the latest message, the earlier turns and the deliveries list. Yes: It is clear what the customer wants and which delivery or order it concerns, so the assistant can act or offer the change. No: The assistant would first have to ask what the customer means, which delivery or order, or what went wrong.
Which action does the customer ask the assistant to take? Choice
Read the latest message, with the earlier turns for anything it refers back to. If the message asks for several things, choose the action the customer asks for first.
Which delivery in the deliveries list is the message about? Choice
Match what the customer says, such as the item, the day, the order number or the kind of delivery, with the tagged lines in the deliveries list. If the message is about more than one delivery, choose the one the customer's first request is about. If only one delivery is listed and the message is about a delivery, choose it.
Which day does the customer ask for the delivery to move to? Choice
Read what the customer asks for the new delivery. Pick the day of the week they name. Code turns it into a date.
Which week does the customer ask for the delivery to move to? Choice
Read what the customer asks for the new delivery. Pick the week in the words they use; do not work it out from a date. Code finds the date.
Which delivery slot does the customer ask for? Choice
Read what the customer asks for the new or changed delivery. Pick the part of the day in the words they use. A reason that rules out a time, such as being at work in the afternoons, points to the other slots only when the customer also says what suits them.
Does the customer type a calendar date for the delivery they want? Yes / No
Read the latest message. Yes: The message gives a day of the month for the delivery they want, with or without the month, such as "the 14th" or "14 October". Code reads the date itself. No: No calendar date appears for the delivery they want. Day names, words such as "next week" or "tomorrow", and house or order numbers are not calendar dates.
Does the message ask for more than one separate change or request? Yes / No
Read the latest message. Yes: The customer asks for two or more separate things, such as moving one delivery and changing the instructions for another. No: The customer asks for one thing, with any details or reasons that go with it. Saying that another delivery should stay as it is, is not a request.
Does the customer express dissatisfaction with our service, charges, decision or conduct? Yes / No
Read the latest message and the earlier turns. Yes: The customer says they are unhappy with us, such as a late or missed delivery, a rude driver, a charge or how a problem was handled. No: The customer asks for something or gives information without saying they are unhappy with us. A plain request to change a delivery, even an urgent one, is not a complaint.
Lens columns
enough_detail, enough_detail_probability, action, action_probability, target_delivery, target_delivery_probability, new_day, new_day_probability, new_week, new_week_probability, time_window, time_window_probability, date_named, date_named_probability, several_requests, several_requests_probability, complaint_expressed, complaint_expressed_probability
Run it on your own text
Add this prism in the app, change any question, and test it on a file of your own.