Class FewShotPromptTemplate
java.lang.Object
com.hw.langchain.prompts.base.BasePromptTemplate
com.hw.langchain.prompts.base.StringPromptTemplate
com.hw.langchain.prompts.few.shot.FewShotPromptTemplate
Prompt template that contains few shot examples.
- Author:
- HamaWhite
-
Field Summary
Fields inherited from class com.hw.langchain.prompts.base.BasePromptTemplate
inputVariables, outputParser, partialVariables
-
Constructor Summary
ConstructorDescriptionFewShotPromptTemplate
(List<Map<String, Object>> examples, PromptTemplate examplePrompt, String prefix, String suffix, List<String> inputVariables) FewShotPromptTemplate
(List<Map<String, Object>> examples, PromptTemplate examplePrompt, String prefix, String suffix, List<String> inputVariables, String exampleSeparator) FewShotPromptTemplate
(List<Map<String, Object>> examples, PromptTemplate examplePrompt, String prefix, String suffix, List<String> inputVariables, String exampleSeparator, BaseOutputParser<?> outputParser) -
Method Summary
Methods inherited from class com.hw.langchain.prompts.base.StringPromptTemplate
formatPrompt
Methods inherited from class com.hw.langchain.prompts.base.BasePromptTemplate
mergePartialAndUserVariables
-
Constructor Details
-
FewShotPromptTemplate
-
FewShotPromptTemplate
-
FewShotPromptTemplate
-
-
Method Details
-
getExamples
-
format
Description copied from class:BasePromptTemplate
Format the prompt with the inputs.- Specified by:
format
in classBasePromptTemplate
- Parameters:
kwargs
- Any arguments to be passed to the prompt template.- Returns:
- A formatted string.
-