Reference/Autoevals library/TypeScript/Modules

Namespace: AnswerCorrectness

Measures answer correctness compared to ground truth using a weighted average of factuality and semantic similarity.

Functions

partial

partial<T>(args): Scorer<string, Omit<{ answerSimilarity?: Scorer<string, {}> ; answerSimilarityWeight?: number ; azureOpenAi?: AzureOpenAiAuth ; client?: OpenAI ; context?: string | string[] ; factualityWeight?: number ; input?: string ; maxTokens?: number ; model?: string ; openAiApiKey?: string ; openAiBaseUrl?: string ; openAiDangerouslyAllowBrowser?: boolean ; openAiDefaultHeaders?: Record<string, string> ; openAiOrganizationId?: string ; temperature?: number }, T> & Partial<Pick<{ answerSimilarity?: Scorer<string, {}> ; answerSimilarityWeight?: number ; azureOpenAi?: AzureOpenAiAuth ; client?: OpenAI ; context?: string | string[] ; factualityWeight?: number ; input?: string ; maxTokens?: number ; model?: string ; openAiApiKey?: string ; openAiBaseUrl?: string ; openAiDangerouslyAllowBrowser?: boolean ; openAiDefaultHeaders?: Record<string, string> ; openAiOrganizationId?: string ; temperature?: number }, T>>>

Type parameters

NameType
Textends "openAiApiKey" | "client" | "openAiOrganizationId" | "openAiBaseUrl" | "openAiDefaultHeaders" | "openAiDangerouslyAllowBrowser" | "azureOpenAi" | "model" | "temperature" | "maxTokens" | "context" | "input" | "factualityWeight" | "answerSimilarityWeight" | "answerSimilarity"

Parameters

NameType
args{ [K in "openAiApiKey" | "client" | "openAiOrganizationId" | "openAiBaseUrl" | "openAiDefaultHeaders" | "openAiDangerouslyAllowBrowser" | "azureOpenAi" | "model" | "temperature" | "maxTokens" | "context" | "input" | "factualityWeight" | "answerSimilarityWeight" | "answerSimilarity"]: Object[K] }

Returns

Scorer<string, Omit<{ answerSimilarity?: Scorer<string, {}> ; answerSimilarityWeight?: number ; azureOpenAi?: AzureOpenAiAuth ; client?: OpenAI ; context?: string | string[] ; factualityWeight?: number ; input?: string ; maxTokens?: number ; model?: string ; openAiApiKey?: string ; openAiBaseUrl?: string ; openAiDangerouslyAllowBrowser?: boolean ; openAiDefaultHeaders?: Record<string, string> ; openAiOrganizationId?: string ; temperature?: number }, T> & Partial<Pick<{ answerSimilarity?: Scorer<string, {}> ; answerSimilarityWeight?: number ; azureOpenAi?: AzureOpenAiAuth ; client?: OpenAI ; context?: string | string[] ; factualityWeight?: number ; input?: string ; maxTokens?: number ; model?: string ; openAiApiKey?: string ; openAiBaseUrl?: string ; openAiDangerouslyAllowBrowser?: boolean ; openAiDefaultHeaders?: Record<string, string> ; openAiOrganizationId?: string ; temperature?: number }, T>>>

Defined in

autoevals/js/partial.ts:5

On this page