<commit_before>var ConversationV1 = require('watson-developer-cloud/conversation/v1');
var vcapServices = require('vcap_services');
var extend = (extend = require('util')._extend);

var tmp = {};
tmp.username = vcapServices.getCredentials('conversation').username;
tmp.password = vcapServices.getCredentials('conversation').password;

var conversation = new ConversationV1(extend({
    path: {workspace_id: '49d2a377-47a0-42aa-9649-cbce4637b624'},
    version_date: "2017-12-09"
}, tmp));

exports.sendMessage = function sendMessage(init, params) {
    console.log("------Conversation Started!------");
    console.log('Conversation Params: ' + params.payload);
    return new Promise(function (resolve, reject) {
        var options = init ? {} : {
            input: {text: params.payload.toString()},
            context: params.context
        };
        conversation.message(options, function (err, response) {
            if (err) {
                console.error("Conversation Error: " + err);
                reject(err);
            }

            console.log("Conversation Response: " + JSON.stringify(response));
            resolve(response);
        });
    });
};<commit_msg>reverted changes<commit_after>var ConversationV1 = require('watson-developer-cloud/conversation/v1');
var conversation = new ConversationV1({
    username: "778dd9b2-02fb-4b22-895f-5c4b0b7a763b",
    password: "<PASSWORD>",
    path: {workspace_id: '49d2a377-47a0-42aa-9649-cbce4637b624'},
    version_date: "2017-12-09"
});

exports.sendMessage = function sendMessage(init, params) {
    console.log("------Conversation Started!------");
    console.log('Conversation Params: ' + params.payload);
    return new Promise(function (resolve, reject) {
        var options = init ? {} : {
            input: {text: params.payload.toString()},
            context: params.context
        };
        conversation.message(options, function (err, response) {
            if (err) {
                console.error("Conversation Error: " + err);
                reject(err);
            }

            console.log("Conversation Response: " + JSON.stringify(response));
            resolve(response);
        });
    });
};
{'fraction_non_alphanumeric': 0.14954545454545454, 'fraction_numerical': 0.03909090909090909, 'mean_word_length': 2.7948275862068965, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6184561', 'n_tokens_mistral': 683, 'n_tokens_neox': 635, 'n_words': 115}