Class ConditionalPromptSelector
java.lang.Object
com.hw.langchain.chains.prompt.selector.BasePromptSelector
com.hw.langchain.chains.prompt.selector.ConditionalPromptSelector
Prompt collection that goes through conditionals.
- Author:
- HamaWhite
-
Constructor Summary
ConstructorDescriptionConditionalPromptSelector
(BasePromptTemplate defaultPrompt, List<org.apache.commons.lang3.tuple.Pair<Predicate<BaseLanguageModel>, BasePromptTemplate>> conditionals) -
Method Summary
Modifier and TypeMethodDescriptionGet default prompt for a language model.
-
Constructor Details
-
ConditionalPromptSelector
public ConditionalPromptSelector(BasePromptTemplate defaultPrompt, List<org.apache.commons.lang3.tuple.Pair<Predicate<BaseLanguageModel>, BasePromptTemplate>> conditionals)
-
-
Method Details
-
getPrompt
Description copied from class:BasePromptSelector
Get default prompt for a language model.- Specified by:
getPrompt
in classBasePromptSelector
- Parameters:
llm
- The BaseLanguageModel object.- Returns:
- The BasePromptTemplate object representing the default prompt.
-