KernelFunctionFromPrompt.Builder<T> Class

  • java.lang.Object
    • com.microsoft.semantickernel.semanticfunctions.KernelFunctionFromPrompt.Builder<T>

Type Parameters

T

the type of the return value of the function

Implements

public static final class KernelFunctionFromPrompt.Builder<T>
implements FromPromptBuilder<T>

A builder for creating a KernelFunction<T> from a prompt template.

Constructor Summary

Constructor Description
Builder()

Method Summary

Modifier and Type Method and Description
FromPromptBuilder<U> withOutputVariable(OutputVariable<U> outputVariable)

Set the output variable for the function.

KernelFunction<T> build()

Create a new KernelFunction instance from the builder.

FromPromptBuilder<T> withDefaultExecutionSettings(PromptExecutionSettings executionSettings)

Set the default execution settings for the function.

FromPromptBuilder<T> withDescription(String description)

Set the description of the function.

FromPromptBuilder<T> withExecutionSettings(Map<String,PromptExecutionSettings> executionSettings)

Set the execution settings for the function.

FromPromptBuilder<T> withInputParameters(List<InputVariable> inputVariables)

Set the input parameters for the function.

FromPromptBuilder<T> withName(String name)

Set the name of the function.

FromPromptBuilder<T> withOutputVariable(String description, String type)

Set the output variable for the function.

FromPromptBuilder<T> withPromptTemplate(PromptTemplate promptTemplate)

Set the prompt template for the function.

FromPromptBuilder<T> withPromptTemplateConfig(PromptTemplateConfig promptTemplateConfig)

Set the prompt template config used to build the function.

FromPromptBuilder<T> withPromptTemplateFactory(PromptTemplateFactory promptTemplateFactory)

Set the prompt template factory used to build the function.

FromPromptBuilder<T> withTemplate(String template)

Set the template for the function.

FromPromptBuilder<T> withTemplateFormat(String templateFormat)

Set the template format for the function.

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

Constructor Details

Builder

public Builder()

Method Details

withOutputVariable

public KernelFunction.FromPromptBuilder withOutputVariable(OutputVariable outputVariable)

Set the output variable for the function.

Parameters:

outputVariable

build

public KernelFunction<T> build()

Create a new KernelFunction instance from the builder.

withDefaultExecutionSettings

public KernelFunction.FromPromptBuilder<T> withDefaultExecutionSettings(PromptExecutionSettings executionSettings)

Set the default execution settings for the function.

Parameters:

executionSettings

withDescription

public KernelFunction.FromPromptBuilder<T> withDescription(String description)

Set the description of the function.

Parameters:

description

withExecutionSettings

public KernelFunction.FromPromptBuilder<T> withExecutionSettings(Map<String,PromptExecutionSettings> executionSettings)

Set the execution settings for the function.

Parameters:

executionSettings

withInputParameters

public KernelFunction.FromPromptBuilder<T> withInputParameters(List<InputVariable> inputVariables)

Set the input parameters for the function.

Parameters:

inputVariables

withName

public KernelFunction.FromPromptBuilder<T> withName(String name)

Set the name of the function.

Parameters:

name

withOutputVariable

public KernelFunction.FromPromptBuilder<T> withOutputVariable(String description, String type)

Set the output variable for the function.

Parameters:

description
type

withPromptTemplate

public KernelFunction.FromPromptBuilder<T> withPromptTemplate(PromptTemplate promptTemplate)

Set the prompt template for the function.

Parameters:

promptTemplate

withPromptTemplateConfig

public KernelFunction.FromPromptBuilder<T> withPromptTemplateConfig(PromptTemplateConfig promptTemplateConfig)

Set the prompt template config used to build the function.

Parameters:

promptTemplateConfig

withPromptTemplateFactory

public KernelFunction.FromPromptBuilder<T> withPromptTemplateFactory(PromptTemplateFactory promptTemplateFactory)

Set the prompt template factory used to build the function.

Parameters:

promptTemplateFactory

withTemplate

public KernelFunction.FromPromptBuilder<T> withTemplate(String template)

Set the template for the function.

Parameters:

template

withTemplateFormat

public KernelFunction.FromPromptBuilder<T> withTemplateFormat(String templateFormat)

Set the template format for the function.

Parameters:

templateFormat

Applies to