Judgment Labs Logo

Judgeval

The main entry point for interacting with the Judgment platform. `Judgeval` connects to your Judgment project and gives you access to evaluation, datasets, and monitoring through the Judgment platform.

The main entry point for interacting with the Judgment platform.

Judgeval connects to your Judgment project and gives you access to evaluation, datasets, and monitoring through the Judgment platform.

import { Judgeval } from "judgeval";

const client = await Judgeval.create({ projectName: "my-project" });

Throws

Error if any required credential is missing.

Static Method

create()

Create a new Judgeval client instance.

Resolves the projectName to a projectId via the Judgment API.

const client = await Judgeval.create({
  projectName: "my-project",
  apiKey: "<your-api-key>",
  organizationId: "<your-organization-id>",
});
async function create(config: JudgevalConfig): Promise<Judgeval>

Parameters

config

required

:

JudgevalConfig

Configuration options. Credentials default to environment variables.

Returns

Promise<Judgeval> - A new Judgeval instance.


offlineTracer()

Create and activate an OfflineTracer for this project.

Reuses the credentials supplied to this Judgeval instance. Each completed root span appends an Example to dataset, carrying the offline trace id and the static exampleFields.

const judgeval = await Judgeval.create({ projectName: "my-project" });
const dataset: Example[] = [];
const tracer = await judgeval.offlineTracer({
  dataset,
  exampleFields: { input: item.input, golden_output: item.goldenOutput },
});
async function offlineTracer(options: JudgevalOfflineTracerOptions): Promise<OfflineTracer>

Parameters

options

required

:

JudgevalOfflineTracerOptions

Returns

Promise<OfflineTracer>