Interface KernelFunction.FromPromptBuilder<T>
-
- Type Parameters:
T- The type of the result of the function
- All Known Implementing Classes:
KernelFunctionFromPrompt.Builder
- Enclosing class:
- KernelFunction<T>
public static interface KernelFunction.FromPromptBuilder<T>Builder for creating aKernelFunctionfrom a prompt.- See Also:
KernelFunctionFromPrompt.Builder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KernelFunction<T>build()Create a new KernelFunction instance from the builder.KernelFunction.FromPromptBuilder<T>withDefaultExecutionSettings(PromptExecutionSettings executionSettings)Set the default execution settings for the function.KernelFunction.FromPromptBuilder<T>withDescription(String description)Set the description of the function.KernelFunction.FromPromptBuilder<T>withExecutionSettings(Map<String,PromptExecutionSettings> executionSettings)Set the execution settings for the function.KernelFunction.FromPromptBuilder<T>withInputParameters(List<InputVariable> inputVariables)Set the input parameters for the function.KernelFunction.FromPromptBuilder<T>withName(String name)Set the name of the function.<U> KernelFunction.FromPromptBuilder<U>withOutputVariable(OutputVariable<U> outputVariable)Set the output variable for the function.KernelFunction.FromPromptBuilder<T>withOutputVariable(String description, String type)Set the output variable for the function.KernelFunction.FromPromptBuilder<T>withPromptTemplate(PromptTemplate promptTemplate)Set the prompt template for the function.KernelFunction.FromPromptBuilder<T>withPromptTemplateConfig(PromptTemplateConfig promptTemplateConfig)Set the prompt template config used to build the function.KernelFunction.FromPromptBuilder<T>withPromptTemplateFactory(PromptTemplateFactory promptTemplateFactory)Set the prompt template factory used to build the function.KernelFunction.FromPromptBuilder<T>withTemplate(String template)Set the template for the function.KernelFunction.FromPromptBuilder<T>withTemplateFormat(String templateFormat)Set the template format for the function.
-
-
-
Method Detail
-
withName
KernelFunction.FromPromptBuilder<T> withName(@Nullable String name)
Set the name of the function.- Parameters:
name- The name of the function- Returns:
- The builder
-
withInputParameters
KernelFunction.FromPromptBuilder<T> withInputParameters(@Nullable List<InputVariable> inputVariables)
Set the input parameters for the function.- Parameters:
inputVariables- The input parameters for the function- Returns:
- The builder
-
withPromptTemplate
KernelFunction.FromPromptBuilder<T> withPromptTemplate(@Nullable PromptTemplate promptTemplate)
Set the prompt template for the function.- Parameters:
promptTemplate- The prompt template for the function- Returns:
- The builder
-
withExecutionSettings
KernelFunction.FromPromptBuilder<T> withExecutionSettings(@Nullable Map<String,PromptExecutionSettings> executionSettings)
Set the execution settings for the function.- Parameters:
executionSettings- The execution settings for the function- Returns:
- The builder
-
withDefaultExecutionSettings
KernelFunction.FromPromptBuilder<T> withDefaultExecutionSettings(@Nullable PromptExecutionSettings executionSettings)
Set the default execution settings for the function.- Parameters:
executionSettings- The default execution settings for the function- Returns:
- The builder
-
withDescription
KernelFunction.FromPromptBuilder<T> withDescription(@Nullable String description)
Set the description of the function.- Parameters:
description- The description of the function- Returns:
- The builder
-
withTemplate
KernelFunction.FromPromptBuilder<T> withTemplate(@Nullable String template)
Set the template for the function.- Parameters:
template- The template for the function- Returns:
- The builder
-
build
KernelFunction<T> build()
Create a new KernelFunction instance from the builder.- Returns:
- The new KernelFunction instance
-
withTemplateFormat
KernelFunction.FromPromptBuilder<T> withTemplateFormat(String templateFormat)
Set the template format for the function.- Parameters:
templateFormat- The template format for the function- Returns:
- The builder
-
withOutputVariable
<U> KernelFunction.FromPromptBuilder<U> withOutputVariable(@Nullable OutputVariable<U> outputVariable)
Set the output variable for the function.- Type Parameters:
U- The type of the output variable- Parameters:
outputVariable- The output variable for the function- Returns:
- The builder
-
withOutputVariable
KernelFunction.FromPromptBuilder<T> withOutputVariable(@Nullable String description, String type)
Set the output variable for the function.- Parameters:
description- The description of the output variabletype- The type of the output variable- Returns:
- The builder
-
withPromptTemplateFactory
KernelFunction.FromPromptBuilder<T> withPromptTemplateFactory(@Nullable PromptTemplateFactory promptTemplateFactory)
Set the prompt template factory used to build the function.- Parameters:
promptTemplateFactory- The prompt template factory for the function- Returns:
- The builder
-
withPromptTemplateConfig
KernelFunction.FromPromptBuilder<T> withPromptTemplateConfig(@Nullable PromptTemplateConfig promptTemplateConfig)
Set the prompt template config used to build the function.- Parameters:
promptTemplateConfig- The prompt template config for the function- Returns:
- The builder
-
-