Documentation for TypeScript Client Library Functions and Classes
Class: VYSPClient
Constructor
constructor( tenantApiKey: String, gateApiKey: String, installationType: String = 'cloud', installationUrl: String | null = null )
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> = {})
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> = {})
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
AuthenticationError
Thrown when authentication with the API fails.
NotFoundError
NotFoundError
Thrown when the requested resource cannot be found.
BadRequestError
BadRequestError
Thrown when the request is not properly formed.
ApiError
ApiError
General error for API issues.
Last updated