Saltar al contenido principal

Class: RelevancyEvaluator

Extends

Implements

  • BaseEvaluator

Constructors

new RelevancyEvaluator()

new RelevancyEvaluator(params?): RelevancyEvaluator

Parameters

params?: RelevancyParams

Returns

RelevancyEvaluator

Overrides

PromptMixin . constructor

Source

packages/core/src/evaluation/Relevancy.ts:31

Properties

evalTemplate()

private evalTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: string

__namedParameters.query: string

Returns

string

Source

packages/core/src/evaluation/Relevancy.ts:28


raiseError

private raiseError: boolean

Source

packages/core/src/evaluation/Relevancy.ts:26


refineTemplate()

private refineTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.contextMsg: string

__namedParameters.existingAnswer: string

__namedParameters.query: string

Returns

string

Source

packages/core/src/evaluation/Relevancy.ts:29


serviceContext?

private optional serviceContext: ServiceContext

Source

packages/core/src/evaluation/Relevancy.ts:25

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin . _getPromptModules

Source

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


_getPrompts()

_getPrompts(): object

Returns

object

evalTemplate()

evalTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.context: string

__namedParameters.query: string

Returns

string

refineTemplate()

refineTemplate: (__namedParameters) => string

Parameters

__namedParameters

__namedParameters.contextMsg: string

__namedParameters.existingAnswer: string

__namedParameters.query: string

Returns

string

Overrides

PromptMixin . _getPrompts

Source

packages/core/src/evaluation/Relevancy.ts:41


_updatePrompts()

_updatePrompts(prompts): void

Parameters

prompts

prompts.evalTemplate

prompts.refineTemplate

Returns

void

Overrides

PromptMixin . _updatePrompts

Source

packages/core/src/evaluation/Relevancy.ts:48


evaluate()

evaluate(__namedParameters): Promise<EvaluationResult>

Parameters

__namedParameters: EvaluatorParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluate

Source

packages/core/src/evaluation/Relevancy.ts:60


evaluateResponse()

evaluateResponse(__namedParameters): Promise<EvaluationResult>

Parameters

__namedParameters: EvaluatorResponseParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluateResponse

Source

packages/core/src/evaluation/Relevancy.ts:120


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

PromptMixin . getPrompts

Source

packages/core/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/core/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/core/src/prompts/Mixin.ts:10