1111import java .util .ArrayList ;
1212import java .util .Collections ;
1313import java .util .HashMap ;
14+ import java .util .HashSet ;
1415import java .util .List ;
1516import java .util .Map ;
1617import java .util .Objects ;
18+ import java .util .Set ;
1719import javax .annotation .Nullable ;
1820
1921/**
@@ -43,6 +45,7 @@ public class PromptTemplateConfig {
4345 @ Nullable
4446 private final String template ;
4547 private final String templateFormat ;
48+ private final Set <PromptTemplateOption > promptTemplateOptions ;
4649 @ Nullable
4750 private final String description ;
4851 private final List <InputVariable > inputVariables ;
@@ -61,6 +64,7 @@ protected PromptTemplateConfig(String template) {
6164 DEFAULT_CONFIG_NAME ,
6265 template ,
6366 SEMANTIC_KERNEL_TEMPLATE_FORMAT ,
67+ Collections .emptySet (),
6468 "" ,
6569 Collections .emptyList (),
6670 new OutputVariable (String .class .getName (), "out" ),
@@ -70,21 +74,23 @@ protected PromptTemplateConfig(String template) {
7074 /**
7175 * Constructor for a prompt template config
7276 *
73- * @param schema Schema version
74- * @param name Name of the template
75- * @param template Template string
76- * @param templateFormat Template format
77- * @param description Description of the template
78- * @param inputVariables Input variables
79- * @param outputVariable Output variable
80- * @param executionSettings Execution settings
77+ * @param schema Schema version
78+ * @param name Name of the template
79+ * @param template Template string
80+ * @param templateFormat Template format
81+ * @param promptTemplateOptions Prompt template options
82+ * @param description Description of the template
83+ * @param inputVariables Input variables
84+ * @param outputVariable Output variable
85+ * @param executionSettings Execution settings
8186 */
8287 @ JsonCreator
8388 public PromptTemplateConfig (
8489 @ JsonProperty ("schema" ) int schema ,
8590 @ Nullable @ JsonProperty ("name" ) String name ,
8691 @ Nullable @ JsonProperty ("template" ) String template ,
8792 @ Nullable @ JsonProperty (value = "template_format" , defaultValue = SEMANTIC_KERNEL_TEMPLATE_FORMAT ) String templateFormat ,
93+ @ Nullable @ JsonProperty (value = "prompt_template_options" ) Set <PromptTemplateOption > promptTemplateOptions ,
8894 @ Nullable @ JsonProperty ("description" ) String description ,
8995 @ Nullable @ JsonProperty ("input_variables" ) List <InputVariable > inputVariables ,
9096 @ Nullable @ JsonProperty ("output_variable" ) OutputVariable outputVariable ,
@@ -96,6 +102,10 @@ public PromptTemplateConfig(
96102 templateFormat = SEMANTIC_KERNEL_TEMPLATE_FORMAT ;
97103 }
98104 this .templateFormat = templateFormat ;
105+ if (promptTemplateOptions == null ) {
106+ promptTemplateOptions = new HashSet <>();
107+ }
108+ this .promptTemplateOptions = promptTemplateOptions ;
99109 this .description = description ;
100110 if (inputVariables == null ) {
101111 this .inputVariables = new ArrayList <>();
@@ -127,6 +137,7 @@ protected PromptTemplateConfig(
127137 @ Nullable String name ,
128138 @ Nullable String template ,
129139 @ Nullable String templateFormat ,
140+ @ Nullable Set <PromptTemplateOption > promptTemplateOptions ,
130141 @ Nullable String description ,
131142 @ Nullable List <InputVariable > inputVariables ,
132143 @ Nullable OutputVariable outputVariable ,
@@ -136,6 +147,7 @@ protected PromptTemplateConfig(
136147 name ,
137148 template ,
138149 templateFormat ,
150+ promptTemplateOptions ,
139151 description ,
140152 inputVariables ,
141153 outputVariable ,
@@ -152,6 +164,7 @@ public PromptTemplateConfig(PromptTemplateConfig promptTemplate) {
152164 promptTemplate .name ,
153165 promptTemplate .template ,
154166 promptTemplate .templateFormat ,
167+ promptTemplate .promptTemplateOptions ,
155168 promptTemplate .description ,
156169 promptTemplate .inputVariables ,
157170 promptTemplate .outputVariable ,
@@ -300,6 +313,15 @@ public int getSchema() {
300313 return schema ;
301314 }
302315
316+ /**
317+ * Get the prompt template options of the prompt template config.
318+ *
319+ * @return The prompt template options of the prompt template config.
320+ */
321+ public Set <PromptTemplateOption > getPromptTemplateOptions () {
322+ return Collections .unmodifiableSet (promptTemplateOptions );
323+ }
324+
303325 /**
304326 * Create a builder for a prompt template config which is a clone of the current object.
305327 *
@@ -358,6 +380,7 @@ public static class Builder {
358380 @ Nullable
359381 private String template ;
360382 private String templateFormat = SEMANTIC_KERNEL_TEMPLATE_FORMAT ;
383+ private final Set <PromptTemplateOption > promptTemplateOptions = new HashSet <>();
361384 @ Nullable
362385 private String description = null ;
363386 private List <InputVariable > inputVariables = new ArrayList <>();
@@ -433,6 +456,11 @@ public Builder withTemplateFormat(String templateFormat) {
433456 return this ;
434457 }
435458
459+ public Builder addPromptTemplateOption (PromptTemplateOption option ) {
460+ promptTemplateOptions .add (option );
461+ return this ;
462+ }
463+
436464 /**
437465 * Set the inputVariables of the prompt template config.
438466 *
@@ -477,6 +505,7 @@ public PromptTemplateConfig build() {
477505 name ,
478506 template ,
479507 templateFormat ,
508+ promptTemplateOptions ,
480509 description ,
481510 inputVariables ,
482511 outputVariable ,
0 commit comments