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. TypeScript/JS Client

Documentation for TypeScript Client Library Functions and Classes

Class: VYSPClient

Constructor

constructor( tenantApiKey: String, gateApiKey: String, installationType: String = 'cloud', installationUrl: String | null = 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(clientRefUserId: String, prompt: String, clientRefInternal: Boolean = false, metadata: Record<string, any> = {})

Sends a request to perform an input check.

  • clientRefUserId (string): Identifier for the user within logs. This is only for logging purposes.

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

  • clientRefInternal (boolean, optional): Whether the user is an internal user or an external user. This is only for logging purposes.

  • metadata (object, optional): Additional metadata related to the input. This is only for logging purposes.

async checkOutput(clientRefUserId: String, prompt: String, modelOutput: String, clientRefInternal: Boolean = false, metadata: Record<string, any> = {})

Sends a request to perform an output check.

  • clientRefUserId (string): Identifier for the user within logs. This is only for logging purposes.

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

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

  • clientRefInternal (boolean, optional): Whether the user is an internal user or an external user. This is only for logging purposes.

  • metadata (object, optional): Additional metadata related to the output. This is only for logging purposes.

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)NextJavaScript Client Library for VYSP API

Last updated 1 year ago