qualifire
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

Qualifire

CodeQL Release Issues Code Coverage Commitizen Friendly Semantic Release

Qualifire SDK

This is the official SDK for interacting with the Qualifire API.

Installation

npm install qualifire

usage

First, import the Qualifire class from the SDK:

import { Qualifire } from 'qualifire-sdk';

Then, create a new instance of the Qualifire class, passing your API key and the base URL of the Qualifire API:

const qualifire = new Qualifire({
  apiKey: 'your-api-key',
});

ℹ️ There are default environment variables if you prefer to set it that way QUALIFIRE_API_KEY

You can now use the evaluate method to evaluate input and output data:

const input = {
  model: 'gpt-3.5-turbo',
  messages: [
    {
      role: 'user',
      content: 'this is my awesome request',
    },
  ],
};

const output = await openai.chat.completions.create(input);

const evaluationResponse = await qualifire.evaluate(input, output); // This will block until the evaluation is done
console.log(evaluationResponse);

Non-blocking execution

In case you want to trigger a completely async evaluation (to view in qualifire's UI) simply add the {async: true} option to your call.

const input = {
  model: 'gpt-3.5-turbo',
  messages: [
    {
      role: 'user',
      content: 'this is my awesome request',
    },
  ],
};

const output = await openai.chat.completions.create(input);

const evaluationResponse = await qualifire.evaluate(input, output, {
  async: true,
}); // This will block until the evaluation is done
console.log(evaluationResponse);

Evaluates the input and output using the Qualifire API. Returns a promise that resolves to the evaluation response, or undefined if async is true.

Package Sidebar

Install

npm i qualifire

Weekly Downloads

2,619

Version

1.1.9

License

MIT

Unpacked Size

27.1 kB

Total Files

7

Last publish

Collaborators

  • drorivry