본문으로 건너뛰기

Class: LLMSingleSelector

A selector that uses the LLM to select a single choice from a list of choices.

Extends

Constructors

new LLMSingleSelector()

new LLMSingleSelector(init): LLMSingleSelector

Parameters

init

init.llm: LLMPredictorType

init.outputParser?: BaseOutputParser <StructuredOutput<Answer[]>>

init.prompt?

Returns

LLMSingleSelector

Overrides

BaseSelector . constructor

Source

packages/core/src/selectors/llmSelectors.ts:123

Properties

llm

llm: LLMPredictorType

Source

packages/core/src/selectors/llmSelectors.ts:119


outputParser

outputParser: BaseOutputParser <StructuredOutput<Answer[]>>

Source

packages/core/src/selectors/llmSelectors.ts:121


prompt()

prompt: (numChoices, contextList, queryStr) => string

Parameters

numChoices: number

contextList: string

queryStr: string

Returns

string

Source

packages/core/src/selectors/llmSelectors.ts:120

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

BaseSelector . _getPromptModules

Source

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


_getPrompts()

_getPrompts(): Record<string, (numChoices, contextList, queryStr) => string>

Returns

Record<string, (numChoices, contextList, queryStr) => string>

Overrides

BaseSelector . _getPrompts

Source

packages/core/src/selectors/llmSelectors.ts:134


_select()

_select(choices, query): Promise <SelectorResult>

Selects a single choice from a list of choices.

Parameters

choices: ToolMetadataOnlyDescription[]

query: QueryBundle

Returns

Promise <SelectorResult>

Overrides

BaseSelector . _select

Source

packages/core/src/selectors/llmSelectors.ts:149


_updatePrompts()

_updatePrompts(prompts): void

Parameters

prompts: Record<string, (numChoices, contextList, queryStr) => string>

Returns

void

Overrides

BaseSelector . _updatePrompts

Source

packages/core/src/selectors/llmSelectors.ts:138


asQueryComponent()

asQueryComponent(): unknown

Returns

unknown

Source

packages/core/src/selectors/llmSelectors.ts:172


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

BaseSelector . getPrompts

Source

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


select()

select(choices, query): Promise <SelectorResult>

Parameters

choices: MetadataType[]

query: QueryType

Returns

Promise <SelectorResult>

Inherited from

BaseSelector . select

Source

packages/core/src/selectors/base.ts:36


updatePrompts()

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

BaseSelector . 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

BaseSelector . validatePrompts

Source

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