跳到主要内容

Class: FaithfulnessEvaluator

Extends

Implements

  • BaseEvaluator

Constructors

new FaithfulnessEvaluator()

new FaithfulnessEvaluator(params?): FaithfulnessEvaluator

Parameters

params?

params.faithFulnessRefinePrompt?

params.faithfulnessSystemPrompt?

params.raiseError?: boolean

params.serviceContext?: ServiceContext

Returns

FaithfulnessEvaluator

Overrides

PromptMixin . constructor

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:29

Properties

evalTemplate()

private evalTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: string

__namedParameters.query: string

Returns

string

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:26


raiseError

private raiseError: boolean

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:25


refineTemplate()

private refineTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: string

__namedParameters.existingAnswer: string

__namedParameters.query: string

Returns

string

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:27


serviceContext?

private optional serviceContext: ServiceContext

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:24

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin . _getPromptModules

Source

packages/llamaindex/src/prompts/Mixin.ts:82


_getPrompts()

protected _getPrompts(): object

Returns

object

Overrides

PromptMixin . _getPrompts

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:45


_updatePrompts()

protected _updatePrompts(promptsDict): void

Parameters

promptsDict

promptsDict.faithFulnessRefinePrompt

promptsDict.faithfulnessSystemPrompt

Returns

void

Overrides

PromptMixin . _updatePrompts

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:52


evaluate()

evaluate(__namedParameters): Promise<EvaluationResult>

Parameters

__namedParameters: EvaluatorParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluate

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:72


evaluateResponse()

evaluateResponse(__namedParameters): Promise<EvaluationResult>

Parameters

__namedParameters: EvaluatorResponseParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluateResponse

Source

packages/llamaindex/src/evaluation/Faithfulness.ts:131


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

PromptMixin . getPrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:27


updatePrompts()

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

PromptMixin . updatePrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:48


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

promptsDict: PromptsDict

moduleDict: ModuleDict

Returns

void

Inherited from

PromptMixin . validatePrompts

Source

packages/llamaindex/src/prompts/Mixin.ts:10