LLMSingleSelector
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:122
A selector that uses the LLM to select a single choice from a list of choices.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LLMSingleSelector(
init
):LLMSingleSelector
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:127
Parameters
Section titled “Parameters”LLM
prompt?
Section titled “prompt?”SingleSelectPrompt
outputParser?
Section titled “outputParser?”BaseOutputParser
<StructuredOutput
<Answer
[]>>
Returns
Section titled “Returns”LLMSingleSelector
Overrides
Section titled “Overrides”Properties
Section titled “Properties”llm:
LLM
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:123
prompt
Section titled “prompt”prompt:
SingleSelectPrompt
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:124
outputParser
Section titled “outputParser”outputParser:
BaseOutputParser
<StructuredOutput
<Answer
[]>>
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:125
Methods
Section titled “Methods”select()
Section titled “select()”select(
choices
,query
):Promise
<SelectorResult
>
Defined in: .build/typescript/packages/llamaindex/src/selectors/base.ts:27
Parameters
Section titled “Parameters”choices
Section titled “choices”MetadataType
[]
QueryType
Returns
Section titled “Returns”Promise
<SelectorResult
>
Inherited from
Section titled “Inherited from”_getPrompts()
Section titled “_getPrompts()”_getPrompts():
Record
<string
,SingleSelectPrompt
>
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:138
Returns
Section titled “Returns”Record
<string
, SingleSelectPrompt
>
Overrides
Section titled “Overrides”BaseSelector._getPrompts
_updatePrompts()
Section titled “_updatePrompts()”_updatePrompts(
prompts
):void
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:142
Parameters
Section titled “Parameters”prompts
Section titled “prompts”Record
<string
, SingleSelectPrompt
>
Returns
Section titled “Returns”void
Overrides
Section titled “Overrides”BaseSelector._updatePrompts
_select()
Section titled “_select()”_select(
choices
,query
):Promise
<SelectorResult
>
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:153
Selects a single choice from a list of choices.
Parameters
Section titled “Parameters”choices
Section titled “choices”QueryBundle
Returns
Section titled “Returns”Promise
<SelectorResult
>
Overrides
Section titled “Overrides”asQueryComponent()
Section titled “asQueryComponent()”asQueryComponent():
unknown
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:180
Returns
Section titled “Returns”unknown
_getPromptModules()
Section titled “_getPromptModules()”
protected
_getPromptModules():object
Defined in: .build/typescript/packages/llamaindex/src/selectors/llmSelectors.ts:184
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
Section titled “Returns”object
Overrides
Section titled “Overrides”BaseSelector._getPromptModules