UNPKG

@maximai/maxim-js

Version:

Maxim AI JS SDK. Visit https://getmaxim.ai for more info.

28 lines (27 loc) 2.46 kB
import { HumanEvaluationConfig, MaximAPIEvaluatorFetchResponse } from "../models/evaluator"; import { MaximAPICreateTestRunResponse, MaximAPITestRunEntryExecutePromptForDataPayload, MaximAPITestRunEntryExecutePromptForDataResponse, MaximAPITestRunEntryExecutePromptChainForDataPayload, MaximAPITestRunEntryExecutePromptChainForDataResponse, MaximAPITestRunEntryExecuteWorkflowForDataPayload, MaximAPITestRunEntryExecuteWorkflowForDataResponse, MaximAPITestRunEntryPushPayload, TestRunResult } from "../models/testRun"; import { ExtractAPIDataType } from "../utils/utils"; import { MaximAPI } from "./maxim"; export declare class MaximTestRunAPI extends MaximAPI { constructor(baseUrl: string, apiKey: string); createTestRun(name: string, workspaceId: string, runType: "SINGLE" | "COMPARISON", evaluatorConfig: ExtractAPIDataType<MaximAPIEvaluatorFetchResponse>[], requiresLocalRun: boolean, workflowId?: string, promptVersionId?: string, promptChainVersionId?: string, humanEvaluationConfig?: HumanEvaluationConfig): Promise<ExtractAPIDataType<MaximAPICreateTestRunResponse>>; markTestRunFailed(testRunId: string): Promise<void>; attachDatasetToTestRun(testRunId: string, datasetId: string): Promise<void>; pushTestRunEntry({ testRun, runConfig, entry }: MaximAPITestRunEntryPushPayload): Promise<void>; markTestRunProcessed(testRunId: string): Promise<void>; getTestRunStatus(testRunId: string): Promise<{ entryStatus: { total: number; running: number; completed: number; failed: number; queued: number; stopped: number; }; testRunStatus: "QUEUED" | "RUNNING" | "FAILED" | "COMPLETE" | "STOPPED"; }>; getTestRunFinalResult(testRunId: string): Promise<TestRunResult>; executeWorkflowForData({ dataEntry, workflowId, contextToEvaluate, }: MaximAPITestRunEntryExecuteWorkflowForDataPayload): Promise<ExtractAPIDataType<MaximAPITestRunEntryExecuteWorkflowForDataResponse>>; executePromptForData({ promptVersionId, input, dataEntry, contextToEvaluate, }: MaximAPITestRunEntryExecutePromptForDataPayload): Promise<ExtractAPIDataType<MaximAPITestRunEntryExecutePromptForDataResponse>>; executePromptChainForData({ promptChainVersionId, input, dataEntry, contextToEvaluate, }: MaximAPITestRunEntryExecutePromptChainForDataPayload): Promise<ExtractAPIDataType<MaximAPITestRunEntryExecutePromptChainForDataResponse>>; }