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.

Last updated