Zum Hauptinhalt springen

Class: RelevancyEvaluator

Hierarchy

Implements

  • BaseEvaluator

Constructors

constructor

new RelevancyEvaluator(params?): RelevancyEvaluator

Parameters

NameType
params?RelevancyParams

Returns

RelevancyEvaluator

Overrides

PromptMixin.constructor

Defined in

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

Properties

evalTemplate

Private evalTemplate: (__namedParameters: { context: string ; query: string }) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
› contextstring
› querystring
Returns

string

Defined in

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


raiseError

Private raiseError: boolean

Defined in

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


refineTemplate

Private refineTemplate: (__namedParameters: { contextMsg: string ; existingAnswer: string ; query: string }) => string

Type declaration

▸ («destructured»): string

Parameters
NameType
«destructured»Object
› contextMsgstring
› existingAnswerstring
› querystring
Returns

string

Defined in

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


serviceContext

Private Optional serviceContext: ServiceContext

Defined in

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

Methods

_getPromptModules

_getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

PromptMixin._getPromptModules

Defined in

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


_getPrompts

_getPrompts(): Object

Returns

Object

NameType
evalTemplate(__namedParameters: { context: string ; query: string }) => string
refineTemplate(__namedParameters: { contextMsg: string ; existingAnswer: string ; query: string }) => string

Overrides

PromptMixin._getPrompts

Defined in

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


_updatePrompts

_updatePrompts(prompts): void

Parameters

NameType
promptsObject
prompts.evalTemplate(__namedParameters: { context: string ; query: string }) => string
prompts.refineTemplate(__namedParameters: { contextMsg: string ; existingAnswer: string ; query: string }) => string

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

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


evaluate

evaluate(«destructured»): Promise<EvaluationResult>

Parameters

NameType
«destructured»EvaluatorParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluate

Defined in

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


evaluateResponse

evaluateResponse(«destructured»): Promise<EvaluationResult>

Parameters

NameType
«destructured»EvaluatorResponseParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluateResponse

Defined in

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

Defined in

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


updatePrompts

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

NameType
promptsDictPromptsDict

Returns

void

Inherited from

PromptMixin.updatePrompts

Defined in

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


validatePrompts

validatePrompts(promptsDict, moduleDict): void

Validates the prompt keys and module keys

Parameters

NameType
promptsDictPromptsDict
moduleDictModuleDict

Returns

void

Inherited from

PromptMixin.validatePrompts

Defined in

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