universal_bot
Version:
Taking the principles of aiml - but allowing a dynamic and extendable *.js environment
60 lines (35 loc) • 1.36 kB
JavaScript
var UniversalBot = require("./index.js");
var debugs = require('debug')('input');
console.log("Hier komt der Test ");
var params = {};
params.aiml = [
"./user/Seminar.json",
"./aiml_de/bot_identity.json",
"./aiml_de/evokation.json",
"./aiml_de/psychiater.json",
];
params.strategy = "./bot_configs/strategy.json";
params.intentions = "./NITIntentions_DE.json";
params.bot_identity = {
name: "UniversalBot",
age: 12,
}
var bot = new UniversalBot( params );
// bot.input("Ich leide unter Hühneraugen", null, "AIML", function( data, error ) {
bot.input("ich bin nicht dumm", null, "AIML", function( data, error ) {
// bot.input("Ich frage mich ob das so in Ordnung ist", null, "AIML", function( data, error ) {
// bot.input("Kann ich eine Kreditkarte nutzen", null, "AIML", function( data, error ) {
// bot.input("Was sind die Kosten der Veranstaltung", null, "AIML", function( data, error ) {
if (error) {
console.log( "ERROR");
console.log( error );
}
if (data) {
debugs("Daten gehen ein");
console.log("ANTWORT: " + data.answer );
if (data.action) {
var x = eval( data.action );
}
}
});
// bot.aiml.input ( { pattern: "What's about me?", condition: { mood: "sad" } }, bot.session, bot.process_aiml);