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?: MultiSelectPrompt

Returns

LLMMultiSelector

Overrides

BaseSelector.constructor

Defined in

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

Properties

llm

llm: LLM<object, object>

Defined in

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


maxOutputs

maxOutputs: number

Defined in

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


outputParser

outputParser: BaseOutputParser<StructuredOutput<Answer[]>>

Defined in

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


prompt

prompt: MultiSelectPrompt

Defined in

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

Methods

_getPromptModules()

protected _getPromptModules(): ModuleRecord

Return a dictionary of sub-modules within the current module that also implement PromptMixin (so that their prompts can also be get/set).

Can be blank if no sub-modules.

Returns

ModuleRecord

Overrides

BaseSelector._getPromptModules

Defined in

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


_getPrompts()

_getPrompts(): object

Returns

object

prompt

prompt: MultiSelectPrompt

Overrides

BaseSelector._getPrompts

Defined in

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


_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:86


_updatePrompts()

_updatePrompts(prompts): void

Parameters

prompts

prompts.prompt: MultiSelectPrompt

Returns

void

Overrides

BaseSelector._updatePrompts

Defined in

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


asQueryComponent()

asQueryComponent(): unknown

Returns

unknown

Defined in

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


getPrompts()

getPrompts(): PromptsRecord

Returns

PromptsRecord

Inherited from

BaseSelector.getPrompts

Defined in

packages/core/prompts/dist/index.d.ts:66


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(prompts): void

Parameters

prompts: PromptsRecord

Returns

void

Inherited from

BaseSelector.updatePrompts

Defined in

packages/core/prompts/dist/index.d.ts:67


validatePrompts()

validatePrompts(promptsDict, moduleDict): void

Parameters

promptsDict: PromptsRecord

moduleDict: ModuleRecord

Returns

void

Inherited from

BaseSelector.validatePrompts

Defined in

packages/core/prompts/dist/index.d.ts:65