Class PromptTemplateConfig


  • public class PromptTemplateConfig
    extends Object
    Metadata for a prompt template.
    • 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
    • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object