Skip to main content

Class: LLMMultiSelector

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

Extends

Constructors

new LLMMultiSelector()

new LLMMultiSelector(init): LLMMultiSelector

Parameters

init

init.llm: LLM<object, object>

init.maxOutputs?: number

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

init.prompt?

Returns

LLMMultiSelector

Overrides

BaseSelector.constructor

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:52

Properties

llm

llm: LLM<object, object>

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:47


maxOutputs

maxOutputs: number

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:49


outputParser

outputParser: BaseOutputParser<StructuredOutput<Answer[]>>

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:50


prompt()

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

Parameters

numChoices: number

contextList: string

queryStr: string

maxOutputs: number

Returns

string

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:48

Methods

_getPromptModules()

protected _getPromptModules(): Record<string, any>

Returns

Record<string, any>

Inherited from

BaseSelector._getPromptModules

Defined in

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


_getPrompts()

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

Returns

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

Overrides

BaseSelector._getPrompts

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:66


_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

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:81


_updatePrompts()

_updatePrompts(prompts): void

Parameters

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

Returns

void

Overrides

BaseSelector._updatePrompts

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:70


asQueryComponent()

asQueryComponent(): unknown

Returns

unknown

Defined in

packages/llamaindex/src/selectors/llmSelectors.ts:109


getPrompts()

getPrompts(): PromptsDict

Returns all prompts from the mixin and its modules

Returns

PromptsDict

Inherited from

BaseSelector.getPrompts

Defined in

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


select()

select(choices, query): Promise<SelectorResult>

Parameters

choices: MetadataType[]

query: QueryType

Returns

Promise<SelectorResult>

Inherited from

BaseSelector.select

Defined in

packages/llamaindex/src/selectors/base.ts:27


updatePrompts()

updatePrompts(promptsDict): void

Updates the prompts in the mixin and its modules

Parameters

promptsDict: PromptsDict

Returns

void

Inherited from

BaseSelector.updatePrompts

Defined in

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

BaseSelector.validatePrompts

Defined in

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