3.0.0 • Published 2 years ago

velocity-api v3.0.0

Weekly downloads
228
License
Apache
Repository
github
Last release
2 years ago

💨 Velocity

A super fast API Wrapper for Perspective.

Requirements

  • Node >= 16
  • Perspective API Access

Installation

Install using one of these commands (depending on your package manager):

npm i velocity-api
pnpm i velocity-api
yarn add velocity-api

Example Usage

  • Note: This is a basic usage guide.

Typescript:

import { Velocity } from 'velocity-api';

(async () => {
  const manager = new Velocity('PERSPECTIVE_API_KEY');

  const scores = await manager.processMessage("I don't like you!", {
    attributes: ['SPAM', 'SEVERE_TOXICITY'],
    languages: ['en'],
    doNotStore: true,
  });

  // The returned value is an object of the attributes and their score.
  console.log(scores.SPAM);
  console.log(scores.SEVERE_TOXICITY);
})();

Javascript:

const { Velocity } = require('velocity-api');

(async () => {
  const manager = new Velocity('PERSPECTIVE_API_KEY');

  const scores = await manager.processMessage("I don't like you!", {
    attributes: ['SPAM', 'SEVERE_TOXICITY'],
    languages: ['en'],
    doNotStore: true,
  });

  // The returned value is an object of the attributes and their score.
  console.log(scores.SPAM);
  console.log(scores.SEVERE_TOXICITY);
})();

License

This repository is licensed under the Apache 2.0 License.

3.0.0

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-nightly.3

3 years ago

1.0.0-nightly.2

3 years ago

1.0.0-nightly.1

3 years ago