Package org.springframework.ai.prompt
Class PromptTemplate
java.lang.Object
org.springframework.ai.prompt.PromptTemplate
- All Implemented Interfaces:
PromptTemplateActions
,PromptTemplateMessageActions
,PromptTemplateStringActions
- Direct Known Subclasses:
AssistantPromptTemplate
,FunctionPromptTemplate
,SystemPromptTemplate
public class PromptTemplate
extends Object
implements PromptTemplateActions, PromptTemplateStringActions, PromptTemplateMessageActions
-
Field Summary
-
Constructor Summary
ConstructorDescriptionPromptTemplate
(String template) PromptTemplate
(String template, Map<String, Object> model) PromptTemplate
(org.springframework.core.io.Resource resource) PromptTemplate
(org.springframework.core.io.Resource resource, Map<String, Object> model) -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
createMessage
(Map<String, Object> model) render()
void
setOutputParser
(OutputParser outputParser) protected void
-
Field Details
-
template
-
templateFormat
-
-
Constructor Details
-
PromptTemplate
public PromptTemplate(org.springframework.core.io.Resource resource) -
PromptTemplate
-
PromptTemplate
-
PromptTemplate
-
-
Method Details
-
getOutputParser
-
setOutputParser
-
add
-
getTemplate
-
getTemplateFormat
-
render
- Specified by:
render
in interfacePromptTemplateStringActions
-
render
- Specified by:
render
in interfacePromptTemplateStringActions
-
createMessage
- Specified by:
createMessage
in interfacePromptTemplateMessageActions
-
createMessage
- Specified by:
createMessage
in interfacePromptTemplateMessageActions
-
create
- Specified by:
create
in interfacePromptTemplateActions
-
create
- Specified by:
create
in interfacePromptTemplateActions
-
getInputVariables
-
validate
-