-
Notifications
You must be signed in to change notification settings - Fork 6
How to create consecutive commands in Laitis
Sergey Mikolaytis edited this page Feb 7, 2018
·
2 revisions
User: I want a pizza
Laitis: Okay, which one?
User: Margarita on a thin dough with the addition of olives
Laitis: What else?
User: No
Laitis: Where to deliver?
User: Heroes of War Street 25 entrance 1 apartment 42
Laitis: Your phone?
User: 8 800 555 35 35
Laitis: To confirm the order, say "Confirm".
User: Confirm
Laitis: Opens the website with a message that the order is accepted, or simply send the order to the server and say that the order is accepted.
- Send each response to the server. It requires the development of logic from the server side (for details see the article "Server processing web requests from Laitis")
- Record the answers in user variables and execute a query on the server or open the site in the last action. Does not require significant development on the server, the logic is open, the server is not DDOS'ed. This option looks better, so it will be explained below.
Create a new collection of commands "Order pizza".
| Voice commands | Actions |
|---|---|
| I want pizza | Say: "Okay, Which one?" |
| Order pizza |
Wait Next Command: {OrderDetails}
|
| Say: "Want something else?" | |
Wait Next Command: {OrderAdditionalDetails}
|
|
| Say: "Where to deliver?" | |
Wait Next Command: {OrderAddress}
|
|
| Say: "Your phone number?" | |
Wait Next Command: {OrderPhone}
|
|
| Say: "To confirm the order, say "Confirm". To cancel order say "Cancel"" | |
Set the value of the variable: {IsOrderSet} = "Yes" |
If you want to open a website, add this command.
| Voice commands | Actions |
|---|---|
| Confirm |
If the value of the variable: {IsOrderSet} equals "Yes" |
| Confirm the order |
Set the value of the variable: {IsOrderSet} = "No" |
Open the website: https://mypizza.ru/orderpizza?order={OrderDetails} &additionalorder={OrderAdditionalDetails} &address={OderAddress} &phone={OrderPhone}
|
|
| Say: "Order accepted" |
If you want to send a quiet request, then this one.
| Voice commands | Actions |
|---|---|
| Confirm |
If the value of the variable: {IsOrderSet} equals "Yes" |
| Confirm the order |
Set the value of the variable: {IsOrderSet} = "No" |
Submit web request: "POST" https://mypizza.ru/orderpizza?order={OrderDetails} &additionalorder={OrderAdditionalDetails} &address={OderAddress} &phone={OrderPhone}
|
|
| Say: "Order accepted" |
Do not forget to give the user a chance to cancel the order.
| Voice commands | Actions |
|---|---|
| Cancel |
If the value of the variable: {IsOrderSet} equals "Yes" |
| Forget it |
Set the value of the variable: {IsOrderSet} = "No" |
| Cancel Order | Say: "Order canceled" |
The logic of the commands can be more complex and more flexible.