Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
//
// Initialize Wit.ai
// ---
// API Reference: https://wit.ai/docs
//
export const wit = new Wit({
accessToken: WIT_TOKEN,
actions: actions,
logger: new log.Logger(log.INFO)
})
// BOT TESTING MODE
if (TESTING_MODE) {
console.log('Bot testing mode!')
dbConnect()
interactive(wit)
}
import { interactive } from 'node-wit';
import WitAI from '../src/wit-ai/wit-ai.service';
require('../src/lib/envVars').config();
const wit = new WitAI(function(session, message) {
console.log(message);
return Promise.resolve();
});
interactive(wit.wit);
} else {
context.missingLocation = true;
delete context.forecast;
}
return resolve(context);
});
},
};
const client = new Wit({
accessToken: wit_token,
actions: actions
});
interactive(client);