Class PromptTemplate
java.lang.Object
org.springframework.ai.chat.prompt.PromptTemplate
- All Implemented Interfaces:
PromptTemplateActions
,PromptTemplateMessageActions
,PromptTemplateStringActions
- Direct Known Subclasses:
AssistantPromptTemplate
,FunctionPromptTemplate
,SystemPromptTemplate
public class PromptTemplate
extends Object
implements PromptTemplateActions, 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()
create
(Map<String, Object> model, ChatOptions modelOptions) create
(ChatOptions modelOptions) createMessage
(List<Media> mediaList) createMessage
(Map<String, Object> model) render()
protected void
-
Field Details
-
template
-
templateFormat
-
-
Constructor Details
-
PromptTemplate
public PromptTemplate(org.springframework.core.io.Resource resource) -
PromptTemplate
-
PromptTemplate
-
PromptTemplate
-
-
Method Details
-
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
-
createMessage
- Specified by:
createMessage
in interfacePromptTemplateMessageActions
-
create
- Specified by:
create
in interfacePromptTemplateActions
-
create
- Specified by:
create
in interfacePromptTemplateActions
-
create
- Specified by:
create
in interfacePromptTemplateActions
-
create
- Specified by:
create
in interfacePromptTemplateActions
-
getInputVariables
-
validate
-