Class: FaithfulnessEvaluator
Hierarchy
-
↳
FaithfulnessEvaluator
Implements
BaseEvaluator
Constructors
constructor
• new FaithfulnessEvaluator(params
): FaithfulnessEvaluator
Parameters
Name | Type |
---|---|
params | Object |
params.faithFulnessRefinePrompt? | (__namedParameters : { context : string ; existingAnswer : string ; query : string }) => string |
params.faithfulnessSystemPrompt? | (__namedParameters : { context : string ; query : string }) => string |
params.raiseError? | boolean |
params.serviceContext? | ServiceContext |
Returns
Overrides
Defined in
packages/core/src/evaluation/Faithfulness.ts:29
Properties
evalTemplate
• Private
evalTemplate: (__namedParameters
: { context
: string
; query
: string
}) => string
Type declaration
▸ («destructured»
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
› context | string |
› query | string |
Returns
string
Defined in
packages/core/src/evaluation/Faithfulness.ts:26
raiseError
• Private
raiseError: boolean
Defined in
packages/core/src/evaluation/Faithfulness.ts:25
refineTemplate
• Private
refineTemplate: (__namedParameters
: { context
: string
; existingAnswer
: string
; query
: string
}) => string
Type declaration
▸ («destructured »
): string
Parameters
Name | Type |
---|---|
«destructured» | Object |
› context | string |
› existingAnswer | string |
› query | string |
Returns
string
Defined in
packages/core/src/evaluation/Faithfulness.ts:27
serviceContext
• Private
Optional
serviceContext: ServiceContext
Defined in
packages/core/src/evaluation/Faithfulness.ts:24
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, any
>
Returns
Record
<string
, any
>
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:82
_getPrompts
▸ _getPrompts(): Object
Returns
Object
Overrides
Defined in
packages/core/src/evaluation/Faithfulness.ts:45
_updatePrompts
▸ _updatePrompts(promptsDict
): void
Parameters
Name | Type |
---|---|
promptsDict | Object |
promptsDict.faithFulnessRefinePrompt | (__namedParameters : { context : string ; existingAnswer : string ; query : string }) => string |
promptsDict.faithfulnessSystemPrompt | (__namedParameters : { context : string ; query : string }) => string |
Returns
void
Overrides
Defined in
packages/core/src/evaluation/Faithfulness.ts:52
evaluate
▸ evaluate(«destructured»
): Promise
<EvaluationResult
>
Parameters
Name | Type |
---|---|
«destructured» | EvaluatorParams |
Returns
Promise
<EvaluationResult
>
Implementation of
BaseEvaluator.evaluate
Defined in
packages/core/src/evaluation/Faithfulness.ts:72
evaluateResponse
▸ evaluateResponse(«destructured»
): Promise
<EvaluationResult
>
Parameters
Name | Type |
---|---|
«destructured» | EvaluatorResponseParams |
Returns
Promise
<EvaluationResult
>
Implementation of
BaseEvaluator.evaluateResponse
Defined in
packages/core/src/evaluation/Faithfulness.ts:131
getPrompts
▸ getPrompts(): PromptsDict
Returns all prompts from the mixin and its modules
Returns
PromptsDict
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:27
updatePrompts
▸ updatePrompts(promptsDict
): void
Updates the prompts in the mixin and its modules
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
Returns
void
Inherited from
Defined in
packages/core/src/prompts/Mixin.ts:48
validatePrompts
▸ validatePrompts(promptsDict
, moduleDict
): void
Validates the prompt keys and module keys
Parameters
Name | Type |
---|---|
promptsDict | PromptsDict |
moduleDict | ModuleDict |
Returns
void