UNPKG

jest-ai

Version:

Custom jest matchers for testing AI applications

13 lines (12 loc) 867 B
import { Similarity } from "./similarity"; import { z } from "zod"; import type { ChatCompletion } from "openai/src/resources/chat/completions"; import type { RequiredActionFunctionToolCall, Run } from "openai/src/resources/beta/threads/runs"; export declare function getMatchers(): { semantic: (rank: Similarity, expected: string, actual: string) => Promise<boolean>; absolute: (expected: string, actual: string) => boolean; zodSchema: (expected: z.Schema<any, any>, actual: string) => boolean; tools: (expectedTools: string[], actual: () => Promise<ChatCompletion>, allCheck: boolean) => Promise<boolean>; assistantTools: (expectedTools: string[] | RequiredActionFunctionToolCall.Function[], actual: Run, allCheck: boolean) => Promise<boolean>; satisfiesStatement: (statement: string, actual: string, model?: string) => Promise<boolean>; };