Passa al contenuto principale

Class: CorrectnessEvaluator

Correctness Evaluator

Hierarchy

Implements

  • BaseEvaluator

Constructors

constructor

new CorrectnessEvaluator(params?): CorrectnessEvaluator

Parameters

NameType
params?CorrectnessParams

Returns

CorrectnessEvaluator

Overrides

PromptMixin.constructor

Defined in

packages/core/src/evaluation/Correctness.ts:35

Properties

correctnessPrompt

Private correctnessPrompt: () => string = defaultCorrectnessSystemPrompt

Type declaration

▸ (): string

Returns

string

Defined in

packages/core/src/evaluation/Correctness.ts:32


llm

Private llm: LLM<Record<string, unknown>>

Defined in

packages/core/src/evaluation/Correctness.ts:30


parserFunction

Private parserFunction: (str: string) => [number, string]

Type declaration

▸ (str): [number, string]

Parameters
NameType
strstring
Returns

[number, string]

Defined in

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


scoreThreshold

Private scoreThreshold: number

Defined in

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

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(): PromptsDict

Returns

PromptsDict

Inherited from

PromptMixin._getPrompts

Defined in

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


_updatePrompts

_updatePrompts(prompts): void

Parameters

NameType
promptsObject
prompts.correctnessPrompt() => string

Returns

void

Overrides

PromptMixin._updatePrompts

Defined in

packages/core/src/evaluation/Correctness.ts:44


evaluate

evaluate(«destructured»): Promise<EvaluationResult>

Parameters

NameType
«destructured»EvaluatorParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluate

Defined in

packages/core/src/evaluation/Correctness.ts:59


evaluateResponse

evaluateResponse(«destructured»): Promise<EvaluationResult>

Parameters

NameType
«destructured»EvaluatorResponseParams

Returns

Promise<EvaluationResult>

Implementation of

BaseEvaluator.evaluateResponse

Defined in

packages/core/src/evaluation/Correctness.ts:105


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