1.1.9 • Published 2 months ago

qualifire v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

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.

1.1.9

2 months ago

1.1.8

2 months ago

1.1.7

2 months ago

1.1.6

2 months ago

1.1.5

2 months ago

1.1.1

2 months ago

1.1.0

2 months ago

1.1.4

2 months ago

1.1.3

2 months ago

1.1.2

2 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.2.0

9 months ago

0.1.0

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago

0.0.0-development

9 months ago