Inspiration
AIML connec alexa custom skill and vidoes player api build
What it does
How we built it
AIML framework and Nodejs
Challenges we ran into
Accomplishments that we're proud of
What we learned
node.js, c#, api skill
What's next for AIML alexa
With new aimlHigh(botAttributes) one can create a new interpreter object. botAttributes is an JSON-Object that can contain attributes of the bot one wants to use in AIML files, e.g. {name: "Bot", age:"42"}. While continued messaging will store the previous answer for use with , you can pass a previous answer like so: new aimlHigh({}, 'last answer').
This object has a function called loadFiles(fileArray) which receives an array of AIML files. This function loads the AIML file into memory. There is also a loadFromString(stringContent) that can also be passed if AIML file has been saved into a string.
Furthermore, the object has a function called findAnswer(clientInput, cb) which receives a message and a callback. The callback is called when an answer was found. The callback of findAnswer should look like this: callback(result, wildCardArray, input). Result is the answer from the AIML file and wildCardArray stores the values of all wildcardInputs passed previously from the client. The original input which triggered the answer is given back via input. Example
aimlHigh = require('./aiml-high'); var interpreter = new aimlHigh({name:'Bot', age:'42'}, 'Goodbye'); interpreter.loadFiles(['./test.aiml.xml']);
var callback = function(answer, wildCardArray, input){ console.log(answer + ' | ' + wildCardArray + ' | ' + input); };
interpreter.findAnswer('What is your name?', callback); interpreter.findAnswer('My name is Ben.', callback); interpreter.findAnswer('What is my name?', callback);
Built With
- aiml
- aiml-framework
- alexa-custom-skill
Log in or sign up for Devpost to join the conversation.