Releases: dialogflow/dialogflow-cordova-client
Fix issue with threads
Added recognitionResultsCallback
v1.5.3 Release 1.5.3
Add partialResultsCallback
Now it is possible to get intermediate recognition results on Android platform.
The usage looks like
ApiAIPlugin.setPartialResultsCallback(function (results) {
console.log(results);
});
Moved to npm
The plugin moved to npm repository according to instruction.
Also take note that plugin was renamed and now must be installed with
cordova plugin add cordova-plugin-apiai
command. So, please, remove old versions of the plugin and reinstall it.
Entities support
Added user entities support.
You can redefine your entities for particular request using entities
query field.
ApiAIPlugin.requestText({
query: text,
entities: [
{
name: "dwarfs",
entries: [
{
value: "Ori",
synonyms: [
"ori",
"Nori"
]
}
]
}
]
},
function (response) {
alert(JSON.stringify(response));
},
function (error) {
alert("Error!\n" + error);
});
See sample app for details.
Protocol versioning
Now custom protocol version can be specified in the initialization options. It is optional feature, and typically should not be used.
ApiAIPlugin.init({
subscriptionKey: subscriptionKey,
clientAccessToken: clientAccessToken,
lang: lang,
version: "20150204"
});
Structure changes and bug fix
Several changes in the Cordova SDK to make the use of the SDK easier:
- Changed signature of the initialization method. Now you should pass keys and other parameters wrapped in a JSON object
ApiAIPlugin.init(
{
subscriptionKey: 'subscriptionKey',
clientAccessToken: 'clientAccessToken',
lang: 'en'
},
function () {
alert("Init success");
},
function (error) {
alert("Init error\n" + error);
});
- You don't need to pass language code in the request method. Language settings are picked up from the SDK configuration defined in the
ApiAIPlugin.init()
method.
function sendVoice() {
try {
ApiAIPlugin.requestVoice(
{}, // empty for simple requests, some optional parameters can be here
function (response) {
// place your result processing here
alert(JSON.stringify(response));
},
function (error) {
// place your error processing here
alert(error);
});
} catch (e) {
alert(e);
}
}
- Fixed bugs with wrong output format on Android platform and issues with initialization callbacks not being called.
Bug fixing for iOS
Fixed bug with stopListening for iOS.
Voice Activity Detection Parameters.
Added "userVAD" parameter for enable/disable end-of-speech feature.
Added method "stopListening" for stop stop record and send data to server.
Bug fixing.
Fixed bug with error installation for ios platform.