npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

botium-asserter-watson-toneanalyzer

v0.0.1

Published

[![NPM](https://nodei.co/npm/botium-asserter-watson-toneanalyzer.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/botium-asserter-watson-toneanalyzer/)

Downloads

6

Readme

Botium Tone Analyzer Asserter

NPM

Codeship Status for codeforequity-at/botium-asserter-watson-toneanalyzer npm version license

This is a Botium asserter for analyzing and verifying the tone of a chatbot. This asserter uses the Watson Tone Analyzer to retrieve the sentiment of the bot response and trigger an assertion failure if given sentiments are matched (impolite, anger, ...).

Configuration

You have to activate the Tone Analzer in your IBM Cloud account, the URL and the credentials are shown on the Manage view.

Configuration of the asserter is done with the args properties (see below).

WATSONTA_URL

Default: https://gateway.watsonplatform.net/tone-analyzer/api

URL of your Watson Tone Analyzer instance

WATSONTA_APIKEY / WATSONTA_USER / WATSONTA_PASSWORD

Depending on your IBM Cloud account, you have either API Key credentials or Username/Password credentials.

The credentials are different than the credentials your are using for logging into the IBM Cloud console

WATSONTA_VERSION

Default: 2017-09-21

WATSONTA_ENDPOINT

Default: toneChat

Either toneChat or tone

The Watson Tone Analyzer supports two different tone analyzer modes, one for general tone analysis, one for customer engagement tone analysis, see here.

WATSONTA_LANGUAGE

Default: en

Content language. For list of supported languages, see here.

WATSONTA_TONE_TRIGGERS

Default: ['impolite', 'frustrated', 'sad']

JSON Array of tones. If any of these tones is identified with high likelihood (see WATSONTA_SCORE_TRIGGER) in the bot response, the test case will fail.

Depending on the WATSONTA_ENDPOINT configured, there are different tones available - see the tone_id fields in the API Docs

WATSONTA_SCORE_TRIGGER

Default: 0.75

Minimum likelihood to trigger a tone match.

Installation

Botium Box

Preconfigured in Botium Box with TONEANALYZER reference code. You have to add your Watson credentials.

See https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/2293815/Botium+Asserters

Botium Core / Botium Bindings / Botium CLI

Install asserter NPM package:

npm install --save botium-asserter-watson-toneanalyzer

Add to botium.json - in this case, it is added as a global asserter running it on all responses. This is the suggested use case.

{
  "botium": {
    "Capabilities": {
      ...
      "ASSERTERS": [
        {
          "ref": "TONEANALYZER",
          "src": "botium-asserter-watson-toneanalyzer",
          "global": true,
          "args": {
            "WATSONTA_URL": "...",
            "WATSONTA_APIKEY": "..."
          }          
        }
      ]
    }
  }
}

Usage

If asserter is configured as global, assertions are done on all bot responses.

Otherwise, you can trigger the assertions by adding it to your convo file:

#me
hey how are you

#bot
TONEANALYZER