UNPKG

judgeval

Version:

Judgment SDK for TypeScript/JavaScript

45 lines (44 loc) 1.85 kB
import { Example } from '../example.js'; import { EvalDataset } from './eval-dataset.js'; import { AxiosResponse } from 'axios'; export declare class EvalDatasetClient { private judgmentApiKey; private organizationId; constructor(judgmentApiKey: string, organizationId: string); createDataset(examples?: Example[]): EvalDataset; /** * Pushes the dataset to the Judgment platform. * @returns True if successful, false otherwise. */ pushDataset(dataset: EvalDataset, alias: string, projectName: string, overwrite?: boolean): Promise<boolean>; /** * Pulls the dataset from the Judgment platform. */ pullDataset(alias: string, projectName: string): Promise<EvalDataset>; /** * Deletes the dataset from the Judgment platform. * @returns True if successful, false otherwise. */ deleteDataset(alias: string, projectName: string): Promise<boolean>; /** * Pulls dataset statistics for a project from the Judgment platform. */ pullProjectDatasetStats(projectName: string): Promise<Record<string, any>>; /** * Inserts new examples into an existing dataset on the Judgment platform. * @returns True if successful, false otherwise. */ insertDataset(alias: string, examples: Example[], projectName: string): Promise<boolean>; /** * Exports a dataset in JSONL format from the Judgment platform. * @returns AxiosResponse containing the stream if successful. */ exportJsonl(alias: string, projectName: string): Promise<AxiosResponse>; /** * Appends examples to an existing dataset on the Judgment platform. * @returns True if successful, false otherwise. */ append(alias: string, examples: Example[], projectName: string): Promise<boolean>; private getAuthHeaders; private handleApiError; }