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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract BaseMessage
To 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.void
setPrompt
(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:BaseMessagePromptTemplate
To messages.- Specified by:
formatMessages
in classBaseMessagePromptTemplate
- Parameters:
kwargs
- keyword arguments- Returns:
- a list of BaseMessage
-
inputVariables
Description copied from class:BaseMessagePromptTemplate
Input variables for this prompt template.- Specified by:
inputVariables
in classBaseMessagePromptTemplate
- Returns:
- a list of input variables
-
setPrompt
-