VYSP.AI Product Documentation
VYSP.AI Homepage
  • Welcome to our Documentation!
  • VYSP.AI Security Platform and API Usage Documentation
  • Basic Concepts of VYSP.AI Security API
  • Get started
    • Rules
    • Flows
    • Gates
    • Knowledge Databases
  • Using the platform
  • SSO Authentication
  • Python Client
    • Python Client Library for VYSP API
    • Quick Setup with Python Client Library
    • Demo Project (Flask/Python)
    • Documentation for Python Client Library Functions and Classes
  • TypeScript/JS Client
    • TS/JS Client Library for VYSP.AI API
    • Quick Setup with TS/JS Client Library
    • Demo Project (Next.JS)
    • Documentation for TypeScript Client Library Functions and Classes
  • JavaScript Client
    • JavaScript Client Library for VYSP API
    • Quick Setup with JavaScript Client Library
    • Demo Project (Next.JS)
    • Documentation for JavaScript Client Library Functions and Classes
Powered by GitBook
On this page
  • Class: VYSPClient
  • Constructor
  • Methods
  • Exceptions
  • AuthenticationError
  • NotFoundError
  • BadRequestError
  • ApiError
  1. JavaScript Client

Documentation for JavaScript Client Library Functions and Classes

Class: VYSPClient

Constructor

constructor( tenantApiKey, gateApiKey, installationType = 'cloud', installationUrl = null )

Creates an instance of VYSPClient.

  • tenantApiKey (string): API key for the tenant.

  • gateApiKey (string): API key for the gate.

  • installationType (string, optional): Specifies the type of installation. Defaults to "cloud".

  • installationUrl (string, optional): Base URL to use if not using the cloud.

Methods

async checkInput(userId, prompt, internal = false, metadata = {})

Sends a request to perform an input check.

  • userId (string): Identifier for the user.

  • prompt (string): Input data to be scanned.

  • internal (boolean, optional): Whether the input is internal.

  • metadata (object, optional): Additional metadata related to the input.

async checkOutput(userId, prompt, modelOutput, internal = false, metadata = {})

Sends a request to perform an output check.

  • userId (string): Identifier for the user.

  • prompt (string): Input data that was scanned in the checkInput function.

  • modelOutput (string): Model output data to be scanned.

  • internal (boolean, optional): Whether the output is internal.

  • metadata (object, optional): Additional metadata related to the output.

Exceptions

AuthenticationError

Thrown when authentication with the API fails.

NotFoundError

Thrown when the requested resource cannot be found.

BadRequestError

Thrown when the request is not properly formed.

ApiError

General error for API issues.

PreviousDemo Project (Next.JS)

Last updated 1 year ago