<commit_before>/*!
 * apiai
 * Copyright(c) 2015 http://api.ai/
 * Apache 2.0 Licensed
 */

'use strict';

// var apiai = require("../module/apiai");
var apiai = require("apiai");

var app = apiai("YOUR_ACCESS_TOKEN");

var options = {
    sessionId: '<UNIQE SESSION ID>',
    contexts: [
        {
            name: 'context_number_one',
            parameters: {
                'some_parameter_of_context': 'parameter value 1'
            }
        }
    ]
};

var request = app.textRequest('Hello', options);

request.on('response', function(response) {
    console.log(JSON.stringify(response, null, '  '));
});

request.on('error', function(error) {
    console.log(error);
});

request.end();
<commit_msg>Update text_request_with_contexts.js<commit_after>/*!
 * apiai
 * Copyright(c) 2015 http://api.ai/
 * Apache 2.0 Licensed
 */

'use strict';

// var apiai = require("../module/apiai");
var apiai = require("apiai");

var app = apiai("<KEY>

var options = {
    sessionId: '1503638187',
    contexts: [
        {
            name: 'context_number_one',
            parameters: {
                'some_parameter_of_context': 'parameter value 1'
            }
        }
    ]
};

var request = app.textRequest('Hello', options);

request.on('response', function(response) {
    console.log(JSON.stringify(response, null, '  '));
});

request.on('error', function(error) {
    console.log(error);
});

request.end();

{'fraction_non_alphanumeric': 0.1699438202247191, 'fraction_numerical': 0.016853932584269662, 'mean_word_length': 2.7401574803149606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5145334', 'n_tokens_mistral': 496, 'n_tokens_neox': 473, 'n_words': 89}