Setting up the JavaScript Client Library for VYSP API is easy. Follow these steps to integrate it into your project.
import VYSPClient from 'vysp-js';
const client = new VYSPClient({
tenantApiKey: 'your_tenant_key',
gateApiKey: 'your_gate_key'
});
const prompt = 'sample input';
const modelOutput = 'sample model output';
async function performCheckInput() {
try {
const response = await client.checkInput('user1', prompt);
console.log(response);
} catch (error) {
console.error('Error:', error.message);
}
}
async function performCheckOutput() {
try {
const response = await client.checkOutput('user1', prompt, modelOutput);
console.log(response);
} catch (error) {
console.error('Error:', error.message);
}
}
performCheckInput();
performCheckOutput();