Class PromptTemplateConfig
- java.lang.Object
-
- com.microsoft.semantickernel.semanticfunctions.PromptTemplateConfig
-
public class PromptTemplateConfig extends Object
Metadata for a prompt template.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPromptTemplateConfig.BuilderBuilder for a prompt template config.
-
Field Summary
Fields Modifier and Type Field Description static intCURRENT_SCHEMAThe current prompt template config schema version.static StringDEFAULT_CONFIG_NAMEThe default name for a prompt template config.static StringSEMANTIC_KERNEL_TEMPLATE_FORMATThe default template format for a prompt template config.
-
Constructor Summary
Constructors Constructor Description PromptTemplateConfig(int schema, String name, String template, String templateFormat, String description, List<InputVariable> inputVariables, OutputVariable outputVariable, Map<String,PromptExecutionSettings> executionSettings)Constructor for a prompt template configPromptTemplateConfig(PromptTemplateConfig promptTemplate)Copy constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PromptTemplateConfig.Builderbuilder()Create a builder for a prompt template config.PromptTemplateConfig.Buildercopy()Create a builder for a prompt template config which is a clone of the current object.static PromptTemplateConfig.BuilderdefaultTemplateBuilder()Create a builder for a prompt template config, where the constructed template will be considered the default to be used if no other config is selected.booleanequals(Object obj)StringgetDescription()Get the description of the prompt template config.Map<String,PromptExecutionSettings>getExecutionSettings()Get the prompt execution settings of the prompt template config.List<InputVariable>getInputVariables()Get the inputVariables of the prompt template config.List<InputVariable>getKernelParametersMetadata()Get the parameters metadata.OutputVariable<?>getKernelReturnParameterMetadata()Get the return parameter metadata.StringgetName()Get the name of the prompt template config.OutputVariablegetOutputVariable()Get the output variable of the prompt template config.intgetSchema()Get the schema version of the prompt template config.StringgetTemplate()Get the template of the prompt template config.StringgetTemplateFormat()Get the template format of the prompt template config.inthashCode()static PromptTemplateConfigparseFromJson(String json)Deserialize the JSON string to a PromptTemplateConfig.
-
-
-
Field Detail
-
CURRENT_SCHEMA
public static final int CURRENT_SCHEMA
The current prompt template config schema version.- See Also:
- Constant Field Values
-
DEFAULT_CONFIG_NAME
public static final String DEFAULT_CONFIG_NAME
The default name for a prompt template config.- See Also:
- Constant Field Values
-
SEMANTIC_KERNEL_TEMPLATE_FORMAT
public static final String SEMANTIC_KERNEL_TEMPLATE_FORMAT
The default template format for a prompt template config.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PromptTemplateConfig
public PromptTemplateConfig(int schema, @Nullable String name, @Nullable String template, @Nullable String templateFormat, @Nullable String description, @Nullable List<InputVariable> inputVariables, @Nullable OutputVariable outputVariable, @Nullable Map<String,PromptExecutionSettings> executionSettings)Constructor for a prompt template config- Parameters:
schema- Schema versionname- Name of the templatetemplate- Template stringtemplateFormat- Template formatdescription- Description of the templateinputVariables- Input variablesoutputVariable- Output variableexecutionSettings- Execution settings
-
PromptTemplateConfig
public PromptTemplateConfig(PromptTemplateConfig promptTemplate)
Copy constructor.- Parameters:
promptTemplate- The prompt template to copy.
-
-
Method Detail
-
parseFromJson
public static PromptTemplateConfig parseFromJson(String json) throws SKException
Deserialize the JSON string to a PromptTemplateConfig.- Parameters:
json- The JSON string to parse- Returns:
- The PromptTemplateConfig object
- Throws:
SKException- If the prompt template config cannot be deserialized.
-
builder
public static PromptTemplateConfig.Builder builder()
Create a builder for a prompt template config.- Returns:
- The prompt template config builder.
-
defaultTemplateBuilder
public static PromptTemplateConfig.Builder defaultTemplateBuilder()
Create a builder for a prompt template config, where the constructed template will be considered the default to be used if no other config is selected.- Returns:
- The default prompt template config.
-
getKernelParametersMetadata
public List<InputVariable> getKernelParametersMetadata()
Get the parameters metadata.- Returns:
- The parameters metadata.
-
getKernelReturnParameterMetadata
public OutputVariable<?> getKernelReturnParameterMetadata()
Get the return parameter metadata.- Returns:
- The return parameter metadata.
-
getName
@Nullable public String getName()
Get the name of the prompt template config.- Returns:
- The name of the prompt template config.
-
getTemplate
@Nullable public String getTemplate()
Get the template of the prompt template config.- Returns:
- The template of the prompt template config.
-
getDescription
@Nullable public String getDescription()
Get the description of the prompt template config.- Returns:
- The description of the prompt template config.
-
getInputVariables
public List<InputVariable> getInputVariables()
Get the inputVariables of the prompt template config.- Returns:
- The input variables of the prompt template config.
-
getOutputVariable
@Nullable public OutputVariable getOutputVariable()
Get the output variable of the prompt template config.- Returns:
- The output variable of the prompt template config.
-
getExecutionSettings
@Nullable public Map<String,PromptExecutionSettings> getExecutionSettings()
Get the prompt execution settings of the prompt template config.- Returns:
- The prompt execution settings of the prompt template config.
-
getTemplateFormat
public String getTemplateFormat()
Get the template format of the prompt template config.- Returns:
- The template format of the prompt template config.
-
getSchema
public int getSchema()
Get the schema version of the prompt template config.- Returns:
- The schema version of the prompt template config.
-
copy
public PromptTemplateConfig.Builder copy()
Create a builder for a prompt template config which is a clone of the current object.- Returns:
- The prompt template config builder.
-
-