Share via


KernelFunction.FromPromptBuilder<T> Interface

Type Parameters

T

The type of the result of the function

public static interface KernelFunction.FromPromptBuilder<T>

Builder for creating a KernelFunction<T> from a prompt.

Method Summary

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

Set the output variable for the function.

abstract KernelFunction<T> build()

Create a new KernelFunction instance from the builder.

abstract FromPromptBuilder<T> withDefaultExecutionSettings(PromptExecutionSettings executionSettings)

Set the default execution settings for the function.

abstract FromPromptBuilder<T> withDescription(String description)

Set the description of the function.

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

Set the execution settings for the function.

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

Set the input parameters for the function.

abstract FromPromptBuilder<T> withName(String name)

Set the name of the function.

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

Set the output variable for the function.

abstract FromPromptBuilder<T> withPromptTemplate(PromptTemplate promptTemplate)

Set the prompt template for the function.

abstract FromPromptBuilder<T> withPromptTemplateConfig(PromptTemplateConfig promptTemplateConfig)

Set the prompt template config used to build the function.

abstract FromPromptBuilder<T> withPromptTemplateFactory(PromptTemplateFactory promptTemplateFactory)

Set the prompt template factory used to build the function.

abstract FromPromptBuilder<T> withTemplate(String template)

Set the template for the function.

abstract FromPromptBuilder<T> withTemplateFormat(String templateFormat)

Set the template format for the function.

Method Details

withOutputVariable

public abstract KernelFunction.FromPromptBuilder withOutputVariable(OutputVariable outputVariable)

Set the output variable for the function.

Parameters:

outputVariable - The output variable for the function

Returns:

The builder

build

public abstract KernelFunction build()

Create a new KernelFunction instance from the builder.

Returns:

The new KernelFunction instance

withDefaultExecutionSettings

public abstract KernelFunction.FromPromptBuilder withDefaultExecutionSettings(PromptExecutionSettings executionSettings)

Set the default execution settings for the function.

Parameters:

executionSettings - The default execution settings for the function

Returns:

The builder

withDescription

public abstract KernelFunction.FromPromptBuilder withDescription(String description)

Set the description of the function.

Parameters:

description - The description of the function

Returns:

The builder

withExecutionSettings

public abstract KernelFunction.FromPromptBuilder withExecutionSettings(Map executionSettings)

Set the execution settings for the function.

Parameters:

executionSettings - The execution settings for the function

Returns:

The builder

withInputParameters

public abstract KernelFunction.FromPromptBuilder withInputParameters(List inputVariables)

Set the input parameters for the function.

Parameters:

inputVariables - The input parameters for the function

Returns:

The builder

withName

public abstract KernelFunction.FromPromptBuilder withName(String name)

Set the name of the function.

Parameters:

name - The name of the function

Returns:

The builder

withOutputVariable

public abstract KernelFunction.FromPromptBuilder withOutputVariable(String description, String type)

Set the output variable for the function.

Parameters:

description - The description of the output variable
type - The type of the output variable

Returns:

The builder

withPromptTemplate

public abstract KernelFunction.FromPromptBuilder withPromptTemplate(PromptTemplate promptTemplate)

Set the prompt template for the function.

Parameters:

promptTemplate - The prompt template for the function

Returns:

The builder

withPromptTemplateConfig

public abstract KernelFunction.FromPromptBuilder withPromptTemplateConfig(PromptTemplateConfig promptTemplateConfig)

Set the prompt template config used to build the function.

Parameters:

promptTemplateConfig - The prompt template config for the function

Returns:

The builder

withPromptTemplateFactory

public abstract KernelFunction.FromPromptBuilder withPromptTemplateFactory(PromptTemplateFactory promptTemplateFactory)

Set the prompt template factory used to build the function.

Parameters:

promptTemplateFactory - The prompt template factory for the function

Returns:

The builder

withTemplate

public abstract KernelFunction.FromPromptBuilder withTemplate(String template)

Set the template for the function.

Parameters:

template - The template for the function

Returns:

The builder

withTemplateFormat

public abstract KernelFunction.FromPromptBuilder withTemplateFormat(String templateFormat)

Set the template format for the function.

Parameters:

templateFormat - The template format for the function

Returns:

The builder

Applies to