Package com.hw.langchain.prompts.prompt
Class PromptTemplate
java.lang.Object
com.hw.langchain.prompts.base.BasePromptTemplate
com.hw.langchain.prompts.base.StringPromptTemplate
com.hw.langchain.prompts.prompt.PromptTemplate
Schema to represent a prompt for an LLM.
- Author:
- HamaWhite
-
Field Summary
Fields inherited from class com.hw.langchain.prompts.base.BasePromptTemplate
inputVariables, outputParser, partialVariables
-
Constructor Summary
ConstructorDescriptionPromptTemplate
(String template, List<String> inputVariables, BaseOutputParser<?> outputParser) PromptTemplate
(List<String> inputVariables, String template) -
Method Summary
Modifier and TypeMethodDescriptionFormat the prompt with the inputs.static PromptTemplate
fromTemplate
(String template) Methods inherited from class com.hw.langchain.prompts.base.StringPromptTemplate
formatPrompt
Methods inherited from class com.hw.langchain.prompts.base.BasePromptTemplate
mergePartialAndUserVariables
-
Constructor Details
-
PromptTemplate
-
PromptTemplate
-
PromptTemplate
public PromptTemplate(String template, List<String> inputVariables, BaseOutputParser<?> outputParser)
-
-
Method Details
-
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.
-
fromTemplate
-