Class: LLMSingleSelector
A selector that uses the LLM to select a single choice from a list of choices.
Hierarchy
-
↳
LLMSingleSelector
Constructors
constructor
• new LLMSingleSelector(init
): LLMSingleSelector
Parameters
Name | Type |
---|---|
init | Object |
init.llm | LLMPredictorType |
init.outputParser? | BaseOutputParser <StructuredOutput <Answer []>> |
init.prompt? | (numChoices : number , contextList : string , queryStr : string ) => string |
Returns
Overrides
Defined in
packages/core/src/selectors/llmSelectors.ts:122
Properties
llm
• llm: LLMPredictorType
Defined in
packages/core/src/selectors/llmSelectors.ts:118
outputParser
• outputParser: BaseOutputParser
<StructuredOutput
<Answer
[]>>
Defined in
packages/core/src/selectors/llmSelectors.ts:120
prompt
• prompt: (numChoices
: number
, contextList
: string
, queryStr
: string
) => string
Type declaration
▸ (numChoices
, contextList
, queryStr
): string
Parameters
Name | Type |
---|---|
numChoices | number |
contextList | string |
queryStr | string |
Returns
string
Defined in
packages/core/src/selectors/llmSelectors.ts:119
Methods
_getPromptModules
▸ _getPromptModules(): Record
<string
, any
>
Returns
Record
<string
, any
>
Inherited from
BaseSelector._getPromptModules
Defined in
packages/core/src/prompts/Mixin.ts:83
_getPrompts
▸ _getPrompts(): Record
<string
, (numChoices
: number
, contextList
: string
, queryStr
: string
) => string
>
Returns
Record
<string
, (numChoices
: number
, contextList
: string
, queryStr
: string
) => string
>
Overrides
Defined in
packages/core/src/selectors/llmSelectors.ts:133
_select
▸ _select(choices
, queryBundle
): Promise
<SelectorResult
>
Selects a single choice from a list of choices.