Package com.hw.langchain.prompts.chat
Class BaseStringMessagePromptTemplate
java.lang.Object
com.hw.langchain.prompts.chat.BaseMessagePromptTemplate
com.hw.langchain.prompts.chat.BaseStringMessagePromptTemplate
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AIMessagePromptTemplate,ChatMessagePromptTemplate,HumanMessagePromptTemplate,SystemMessagePromptTemplate
- Author:
- HamaWhite
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BaseMessageTo a BaseMessage.formatMessages(Map<String, Object> kwargs) To messages.static <T extends BaseStringMessagePromptTemplate>
TfromTemplate(Class<T> cls, String template) Input variables for this prompt template.voidsetPrompt(StringPromptTemplate prompt)
-
Field Details
-
prompt
-
-
Constructor Details
-
BaseStringMessagePromptTemplate
public BaseStringMessagePromptTemplate()
-
-
Method Details
-
fromTemplate
public static <T extends BaseStringMessagePromptTemplate> T fromTemplate(Class<T> cls, String template) -
format
To a BaseMessage. -
formatMessages
Description copied from class:BaseMessagePromptTemplateTo messages.- Specified by:
formatMessagesin classBaseMessagePromptTemplate- Parameters:
kwargs- keyword arguments- Returns:
- a list of BaseMessage
-
inputVariables
Description copied from class:BaseMessagePromptTemplateInput variables for this prompt template.- Specified by:
inputVariablesin classBaseMessagePromptTemplate- Returns:
- a list of input variables
-
setPrompt
-