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
<{ context?
: string
| string
[] ; input?
: string
; model?
: string
} & { maxTokens?
: number
; temperature?
: number
} & OpenAIAuth
& { answerSimilarity?
: Scorer
<string
, {}> ; answerSimilarityWeight?
: number
; factualityWeight?
: number
}, T
> & Partial
<Pick
<{ context?
: string
| string
[] ; input?
: string
; model?
: string
} & { maxTokens?
: number
; temperature?
: number
} & OpenAIAuth
& { answerSimilarity?
: Scorer
<string
, {}> ; answerSimilarityWeight?
: number
; factualityWeight?
: number
}, T
>>>
Type parameters
Name | Type |
---|---|
T | extends "model" | "maxTokens" | "temperature" | keyof OpenAIAuth | "input" | "context" | "factualityWeight" | "answerSimilarityWeight" | "answerSimilarity" |
Parameters
Name | Type |
---|---|
args | { [K in "model" | "maxTokens" | "temperature" | keyof OpenAIAuth | "input" | "context" | "factualityWeight" | "answerSimilarityWeight" | "answerSimilarity"]: (Object & Object & OpenAIAuth & Object)[K] } |
Returns
Scorer
<string
, Omit
<{ context?
: string
| string
[] ; input?
: string
; model?
: string
} & { maxTokens?
: number
; temperature?
: number
} & OpenAIAuth
& { answerSimilarity?
: Scorer
<string
, {}> ; answerSimilarityWeight?
: number
; factualityWeight?
: number
}, T
> & Partial
<Pick
<{ context?
: string
| string
[] ; input?
: string
; model?
: string
} & { maxTokens?
: number
; temperature?
: number
} & OpenAIAuth
& { answerSimilarity?
: Scorer
<string
, {}> ; answerSimilarityWeight?
: number
; factualityWeight?
: number
}, T
>>>