Basic

Qualifire provides an SDK to help you integrate our services into your application. The SDK is available for the following languages:

Node.js

To use the Node.js SDK, you need to install it using npm:
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.

Working with Text

You can also send parsed text to the SDK for evaluation
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.
API Reference documentation is here.