0.0.1 • Published 5 years ago

cleverbot-with-sessions v0.0.1

Weekly downloads
6
License
-
Repository
github
Last release
5 years ago

cleverbot-with-sessions

A node.js client for talking to cleverbot.
It allows to manage sessions and change bot's characteristics (tweaking).

Installation:

Installation via npm:

 npm install cleverbot-with-sessions

##First time initiation:

To use cleverbot, you need an API key, which you can obtain here: https://www.cleverbot.com/api/my-account

    const cleverbotWithSessions = require('cleverbot-with-sessions');
    
    let bot = new cleverbotWithSessions("YOUR-API-KEY")

##Usage

###Ask request:

ParamTypeOptionalDefaultDescription
inputStringNoInput message.
csStringYes""Previously obtained cleverbot state (session) to continue from (default if new conversation).
let input = "Hello"

bot.ask(input, cs).then(response => {
    console.log(response)
})

###Response:

{ cs:'MXYxCTh2MQlBdldYQ1BNM0U3MzUJMUZ2MTU2ODExMDQzNwk2NHZIZWxsby4JNjRpV2hhdCdzIHlvdXIgbmFtZT8J',
  output: "What's your name?" }

cs - this parameter stands for “cleverbot state”. It is the encoded state of the conversation so far and includes the whole conversation history up to that point. (Store it somewhere to return to this particular session, it changes after each request)

###Configuring tweaking

ParamTypeOptionalDefaultDescription
tweak1IntegerYes-1Tweak from sesnsible(0) to wacky(100).
tweak2IntegerYes-1Tweak from shy(0) to talkative(100).
tweak3IntegerYes-1Tweak from self-centred(0) to attentive(100).

*Pass -1 if you want to reset it to default

bot.setTweak(-1, 0, 90)

To fully enjoy sessions - store cs and tweaking values. Remember to setTweak() before each time you change session, unless you want to use the same tweak settings.

Made by Sap#7777

0.0.1

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago