/analyse/analyse/:requestId
{
"query": "me and paddington have a meeting"
}{
"success": true,
"type": "response",
"message": "Event Created",
"details": {
"inviteEmails": [
"[email protected]",
"[email protected]"
],
"time": "2pm",
"date": "tomorrow",
"name": "awesomeness4eva"
}
}- Put query in analyser (this converts what the user says to a JSON response we understand)
- Analyser gives its reponse
- e.g.
{ category: ‘googleCalendar’, ‘method’: create, details: {} }
- e.g.
- Check if there is a
requestId(is the request and answer to an earlier question?)- if there is one check the cache and add the
parsedDetailsinfo todetailsbefore handing it over to the apiController
- if there is one check the cache and add the
- Put result in
googleCalendarapiController and handle based on the given method and details- Case 1: apiController says he needs more info
(type === ‘question')- e.g.
{ success: true, type: 'question', message: 'I need a time', parsedDetails: {} } - add
parsedDetailsto cache
- e.g.
- Case 2: apiController says it’s done
(type === ‘response')- e.g.
{ success: true, type: 'response', message: 'Appointment Created' }
- e.g.
- Case 1: apiController says he needs more info
