To use the Node.js SDK, you need to install it using npm:
Copy
npm install qualifire
Then, you can use the SDK in your application:⚠️ Note if the argument of apiKey is not provided the SDK will look for a value in the environment variable QUALIFIRE_API_KEY.
You can also send parsed text to the SDK for evaluation
Copy
import { Qualifire } from "qualifire";const qualifire = new Qualifire();qualifire.evaluate({ input: "What is the capital of France?", output: "Paris", promptInjections: true, piiCheck: true, hallucinationsCheck: true, groundingCheck: true, consistencyCheck: true, assertions: ["don't give medical advice"], dangerousContentCheck: true, harassmentCheck: true, hateSpeechCheck: true, sexualContentCheck: true,});
This will log the evaluation to the web UI and trigger the evaluation in the background.ℹ️ Note The result of the evaluation is logged in the webUI of qualifire for you to check.