Share via


PromptTemplateConfig.Builder Class

  • java.lang.Object
    • com.microsoft.semantickernel.semanticfunctions.PromptTemplateConfig.Builder

public static class PromptTemplateConfig.Builder

Builder for a prompt template config.

Method Summary

Modifier and Type Method and Description
Builder addInputVariable(InputVariable inputVariable)

Add an input variable to the prompt template config.

Builder addPromptTemplateOption(PromptTemplateOption option)

Set the prompt template options.

PromptTemplateConfig build()

Build the prompt template config.

Builder withDescription(String description)

Set the description of the prompt template config.

Builder withExecutionSettings(Map<String,PromptExecutionSettings> executionSettings)

Set the prompt execution settings of the prompt template config.

Builder withInputVariables(List<InputVariable> inputVariables)

Set the inputVariables of the prompt template config.

Builder withName(String name)

Set the name of the prompt template config.

Builder withOutputVariable(OutputVariable<?> outputVariable)

Set the output variable of the prompt template config.

Builder withTemplate(String template)

Set the template of the prompt template config.

Builder withTemplateFormat(String templateFormat)

Set the template format of the prompt template config.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

addInputVariable

public PromptTemplateConfig.Builder addInputVariable(InputVariable inputVariable)

Add an input variable to the prompt template config.

Parameters:

inputVariable - The input variable to add.

Returns:

this builder

addPromptTemplateOption

public PromptTemplateConfig.Builder addPromptTemplateOption(PromptTemplateOption option)

Set the prompt template options.

Parameters:

option - The prompt template option to add.

Returns:

this builder.

build

public PromptTemplateConfig build()

Build the prompt template config.

Returns:

The prompt template config.

withDescription

public PromptTemplateConfig.Builder withDescription(String description)

Set the description of the prompt template config.

Parameters:

description - The description of the prompt template config.

Returns:

this builder

withExecutionSettings

public PromptTemplateConfig.Builder withExecutionSettings(Map executionSettings)

Set the prompt execution settings of the prompt template config.

Parameters:

executionSettings - The prompt execution settings of the prompt template config.

Returns:

this builder

withInputVariables

public PromptTemplateConfig.Builder withInputVariables(List inputVariables)

Set the inputVariables of the prompt template config.

Parameters:

inputVariables - The input variables of the prompt template config.

Returns:

this builder

withName

public PromptTemplateConfig.Builder withName(String name)

Set the name of the prompt template config.

Parameters:

name - The name of the prompt template config.

Returns:

this builder

withOutputVariable

public PromptTemplateConfig.Builder withOutputVariable(OutputVariable outputVariable)

Set the output variable of the prompt template config.

Parameters:

outputVariable - The output variable of the prompt template config.

Returns:

this builder

withTemplate

public PromptTemplateConfig.Builder withTemplate(String template)

Set the template of the prompt template config.

Parameters:

template - The template of the prompt template config.

Returns:

this builder

withTemplateFormat

public PromptTemplateConfig.Builder withTemplateFormat(String templateFormat)

Set the template format of the prompt template config.

Parameters:

templateFormat - The template format of the prompt template config.

Returns:

this builder

Applies to