Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this module broken with the latest version of Wit.ai? #15

Open
lbustelo opened this issue Sep 6, 2016 · 2 comments
Open

Is this module broken with the latest version of Wit.ai? #15

lbustelo opened this issue Sep 6, 2016 · 2 comments

Comments

@lbustelo
Copy link

lbustelo commented Sep 6, 2016

Getting "WARNING":"DEPRECATED" in the returned payload. I can see my intent in the intent array, but not on the top object under outcomes.

@Shreeraj1746
Copy link

Shreeraj1746 commented Sep 18, 2016

There has been an update that fixes it. But I think the package is not update in npm. I installed it using npm today and I get the older version where wit.hear method handles for the old API response.

The code on git however is updated and works as it should.

Update:
This is how I got it to work. Taking a look at the message returned from the API, I saw it was kind of weird. This is a very hacky fix but this is giving me the expected behavior.

middleware.hears = function(tests, message) {
//console.log(message);
obj = message.intents[0].entities
var count = Object.keys(obj).length;
if (count != 0) {
for (var i = 0; i < message.intents[0].entities.intent.length; i++) {
for (var t = 0; t < tests.length; t++) {
if (message.intents[0].entities.intent[0].value == tests[t] &&
message.intents[0].entities.intent[0].confidence >= config.minimum_confidence) {
return true;
}
}
}
}
return false;
};

@simpixelated
Copy link

I think this may be related:
https://github.com/wit-ai/node-wit#changing-the-api-version

On 2016, May 11th, the /message API was updated to reflect the new Bot Engine model: intent are now entities. We updated the SDK to the latest version: 20160516. You can target a specific version by passing the apiVersion parameter when creating the Wit object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants