IBM-Cloud / insurance-bot

A message based insurance experience
http://cloudco.mybluemix.net
Other
36 stars 57 forks source link

iOs bot crashes when conversation is "can you tell me about my dental insurance" #141

Closed l2fprod closed 7 years ago

l2fprod commented 7 years ago

Start the iOS app Go to the chat Say "can you tell me about my dental insurance"

No reply from Ana

full log from server:

server starting on http://localhost:6042
successful login
POST /login 302 245.308 ms - 35
GET /loginSuccess 200 159.039 ms - 109
Request body is:  {}
Got response from Ana:  {"intents":[],"entities":[],"input":{},"output":{"log_messages":[],"text":["Hey ! Let me know if you need any help or get stuck looking for information."],"nodes_visited":["node_6_1475611948267"]},"context":{"conversation_id":"ee665ac5-934d-4c21-a0d2-f4009d607ba7","system":{"dialog_stack":["root"],"dialog_turn_counter":1,"dialog_request_counter":1}}}
POST /api/ana 200 946.828 ms - 350
Sending log updates to dashboard
doc:  null
Request body is:  { text: 'can you tell me about my dental insurance',
  context: 
   { system: 
      { dialog_stack: [Object],
        dialog_turn_counter: 1,
        dialog_request_counter: 1 },
     conversation_id: 'ee665ac5-934d-4c21-a0d2-f4009d607ba7' } }
Got response from Ana:  {"intents":[{"intent":"select_service","confidence":0.9699759861929849}],"entities":[{"entity":"types","location":[25,31],"value":"dental"}],"input":{"text":"can you tell me about my dental insurance"},"output":{"log_messages":[],"text":["Alright, I can tell you more about your dental plan. Let's narrow it down a little. Which procedure do you need information for?"],"nodes_visited":["node_8_1470846944134"]},"context":{"system":{"dialog_stack":["node_8_1470846944134"],"dialog_turn_counter":2,"dialog_request_counter":2},"conversation_id":"ee665ac5-934d-4c21-a0d2-f4009d607ba7","chosen_service":"dental"}}
Service:  dental
/Users/fred/dev/cloudco/insurance-bot/bot.js:290
        var i = services.indexOf(service);
                        ^

TypeError: Cannot read property 'indexOf' of undefined
    at updateContextObject (/Users/fred/dev/cloudco/insurance-bot/bot.js:290:25)
    at /Users/fred/dev/cloudco/insurance-bot/bot.js:85:21
    at Request._callback (/Users/fred/dev/cloudco/insurance-bot/node_modules/watson-developer-cloud/lib/requestwrapper.js:75:5)
    at Request.self.callback (/Users/fred/dev/cloudco/insurance-bot/node_modules/watson-developer-cloud/node_modules/request/request.js:187:22)
    at emitTwo (events.js:100:13)
    at Request.emit (events.js:185:7)
    at Request.<anonymous> (/Users/fred/dev/cloudco/insurance-bot/node_modules/watson-developer-cloud/node_modules/request/request.js:1044:10)
    at emitOne (events.js:90:13)
    at Request.emit (events.js:182:7)
    at IncomingMessage.<anonymous> (/Users/fred/dev/cloudco/insurance-bot/node_modules/watson-developer-cloud/node_modules/request/request.js:965:12)
    at emitNone (events.js:85:20)
    at IncomingMessage.emit (events.js:179:7)
    at endReadableNT (_stream_readable.js:913:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
[nodemon] app crashed - waiting for file changes before starting...
l2fprod commented 7 years ago

the initial reply from Ana shows that she has no context about services or procedures for the current user.