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
ConstructorsConstructorDescriptionPromptTemplate(String template, List<String> inputVariables, BaseOutputParser<?> outputParser) PromptTemplate(List<String> inputVariables, String template) -
Method Summary
Modifier and TypeMethodDescriptionFormat the prompt with the inputs.static PromptTemplatefromTemplate(String template) Methods inherited from class com.hw.langchain.prompts.base.StringPromptTemplate
formatPromptMethods 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:BasePromptTemplateFormat the prompt with the inputs.- Specified by:
formatin classBasePromptTemplate- Parameters:
kwargs- Any arguments to be passed to the prompt template.- Returns:
- A formatted string.
-
fromTemplate
-