/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
parsedDetails
info todetails
before handing it over to the apiController
- if there is one check the cache and add the
- Put result in
googleCalendar
apiController 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
parsedDetails
to 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