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
Name | Type |
---|---|
T | extends "openAiApiKey" | "client" | "openAiOrganizationId" | "openAiBaseUrl" | "openAiDefaultHeaders" | "openAiDangerouslyAllowBrowser" | "azureOpenAi" | "model" | "temperature" | "maxTokens" | "context" | "input" | "factualityWeight" | "answerSimilarityWeight" | "answerSimilarity" |
Parameters
Name | Type |
---|---|
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
>>>