{"action":"created","issue":{"url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/issues/255","repository_url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger","labels_url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/issues/255/comments","events_url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/issues/255/events","html_url":"https://github.com/swapagarwal/JARVIS-on-Messenger/pull/255","id":247352069,"number":255,"title":"Added support for both new and old API's response structure","user":{"login":"ahmedsadman","id":11042267,"avatar_url":"https://avatars2.githubusercontent.com/u/11042267?v=4","gravatar_id":"","url":"https://api.github.com/users/ahmedsadman","html_url":"https://github.com/ahmedsadman","followers_url":"https://api.github.com/users/ahmedsadman/followers","following_url":"https://api.github.com/users/ahmedsadman/following{/other_user}","gists_url":"https://api.github.com/users/ahmedsadman/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmedsadman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmedsadman/subscriptions","organizations_url":"https://api.github.com/users/ahmedsadman/orgs","repos_url":"https://api.github.com/users/ahmedsadman/repos","events_url":"https://api.github.com/users/ahmedsadman/events{/privacy}","received_events_url":"https://api.github.com/users/ahmedsadman/received_events","type":"User","site_admin":false},"labels":[{"id":359594745,"url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/labels/Improvement","name":"Improvement","color":"dde628","default":false},{"id":367724130,"url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/labels/Work%20In%20Progress","name":"Work In Progress","color":"fcd22a","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-08-02T11:03:40Z","updated_at":"2017-08-05T16:26:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/pulls/255","html_url":"https://github.com/swapagarwal/JARVIS-on-Messenger/pull/255","diff_url":"https://github.com/swapagarwal/JARVIS-on-Messenger/pull/255.diff","patch_url":"https://github.com/swapagarwal/JARVIS-on-Messenger/pull/255.patch"},"body":"The newest version of wit.ai uses a different response structure. In this new structure, \"intent\" is NOT a separate key, instead it is integrated in \"entities\". \r\n\r\nSo, when new contributors teaches the WIT ai to work with their module, they will face problems because JARVIS uses older api version which uses different response structure."},"comment":{"url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/issues/comments/320452962","html_url":"https://github.com/swapagarwal/JARVIS-on-Messenger/pull/255#issuecomment-320452962","issue_url":"https://api.github.com/repos/swapagarwal/JARVIS-on-Messenger/issues/255","id":320452962,"user":{"login":"astroengisci","id":2815515,"avatar_url":"https://avatars3.githubusercontent.com/u/2815515?v=4","gravatar_id":"","url":"https://api.github.com/users/astroengisci","html_url":"https://github.com/astroengisci","followers_url":"https://api.github.com/users/astroengisci/followers","following_url":"https://api.github.com/users/astroengisci/following{/other_user}","gists_url":"https://api.github.com/users/astroengisci/gists{/gist_id}","starred_url":"https://api.github.com/users/astroengisci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astroengisci/subscriptions","organizations_url":"https://api.github.com/users/astroengisci/orgs","repos_url":"https://api.github.com/users/astroengisci/repos","events_url":"https://api.github.com/users/astroengisci/events{/privacy}","received_events_url":"https://api.github.com/users/astroengisci/received_events","type":"User","site_admin":false},"created_at":"2017-08-05T16:26:10Z","updated_at":"2017-08-05T16:26:10Z","body":"@swapagarwal I had the same problem when I was writing my dice extension. If you go into wit.ai, create a new bot, and sub in its access key, even though the request includes the version, the format is different. Somehow, \"intent\" is now included in the \"entities\" block of the JSON by default, rather than being it's own block right under \"outcomes\". Just like @ahmedsadman, I had to modify my local code for testing purposes. \r\n\r\nSo, your wit.ai returns:\r\n\r\n    \"outcomes\":\r\n    {\r\n        \"intent\":\r\n        {\r\n            // which module should handle it\r\n        }\r\n        \"entities\":\r\n        {\r\n            // stuff for the module to handle\r\n        }\r\n    }\r\n\r\nHowever, with a new app made for testing purposes, it returns:\r\n\r\n    \"outcomes\":\r\n    {\r\n        \"entities\":\r\n        {\r\n            \"intent\":\r\n            {\r\n                // which module should handle it\r\n            }\r\n            \"some_other_entity\":\r\n            {\r\n                // stuff for the module to handle\r\n            }\r\n        }\r\n    }"}}
{"actor":{"display_login":"astroengisci"}}