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: LLM
<object
, object
>
• init.outputParser?: BaseOutputParser
<StructuredOutput
<Answer
[]>>
• init.prompt?: SingleSelectPrompt
Returns
Overrides
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:127
Properties
llm
llm:
LLM
<object
,object
>
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:123
outputParser
outputParser:
BaseOutputParser
<StructuredOutput
<Answer
[]>>
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:125
prompt
prompt:
SingleSelectPrompt
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:124
Methods
_getPromptModules()
protected
_getPromptModules():object
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
object
Overrides
BaseSelector
._getPromptModules
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:184
_getPrompts()
_getPrompts():
Record
<string
,SingleSelectPrompt
>
Returns
Record
<string
, SingleSelectPrompt
>
Overrides
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:138
_select()
_select(
choices
,query
):Promise
<SelectorResult
>
Selects a single choice from a list of choices.
Parameters
• choices: ToolMetadataOnlyDescription
[]
• query: QueryBundle
Returns
Promise
<SelectorResult
>
Overrides
Defined in
packages/llamaindex/src/selectors/llmSelectors.ts:153
_updatePrompts()
_updatePrompts(
prompts
):void