Class KernelFunctionArguments.Builder
- java.lang.Object
-
- com.microsoft.semantickernel.semanticfunctions.KernelFunctionArguments.Builder
-
- All Implemented Interfaces:
SemanticKernelBuilder<KernelFunctionArguments>
- Enclosing class:
- KernelFunctionArguments
public static class KernelFunctionArguments.Builder extends Object implements SemanticKernelBuilder<KernelFunctionArguments>
Builder for ContextVariables
-
-
Constructor Summary
Constructors Constructor Description Builder()Create a new instance of Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KernelFunctionArgumentsbuild()Build the object.<T> KernelFunctionArguments.BuilderwithInput(ContextVariable<T> content)Builds an instance with the given content in the default main keyKernelFunctionArguments.BuilderwithInput(Object content)Builds an instance with the given content in the default main key<T> KernelFunctionArguments.BuilderwithInput(T content, ContextVariableTypeConverter<T> typeConverter)Builds an instance with the given content in the default main key<T> KernelFunctionArguments.BuilderwithVariable(String key, ContextVariable<T> value)Set variableKernelFunctionArguments.BuilderwithVariable(String key, Object value)Set variable, uses the default type converters<T> KernelFunctionArguments.BuilderwithVariable(String key, T value, ContextVariableTypeConverter<T> typeConverter)Set variableKernelFunctionArguments.BuilderwithVariables(Map<String,ContextVariable<?>> map)Builds an instance with the given variables
-
-
-
Method Detail
-
withInput
public <T> KernelFunctionArguments.Builder withInput(ContextVariable<T> content)
Builds an instance with the given content in the default main key- Type Parameters:
T- Type of the value- Parameters:
content- Entry to place in the "input" slot- Returns:
- {$code this} Builder for fluent coding
-
withInput
public KernelFunctionArguments.Builder withInput(Object content)
Builds an instance with the given content in the default main key- Parameters:
content- Entry to place in the "input" slot- Returns:
- {$code this} Builder for fluent coding
- Throws:
SKException- if the content cannot be converted to a ContextVariable
-
withInput
public <T> KernelFunctionArguments.Builder withInput(T content, ContextVariableTypeConverter<T> typeConverter)
Builds an instance with the given content in the default main key- Type Parameters:
T- Type of the value- Parameters:
content- Entry to place in the "input" slottypeConverter- Type converter for the content- Returns:
- {$code this} Builder for fluent coding
- Throws:
SKException- if the content cannot be converted to a ContextVariable
-
withVariables
public KernelFunctionArguments.Builder withVariables(@Nullable Map<String,ContextVariable<?>> map)
Builds an instance with the given variables- Parameters:
map- Existing variables- Returns:
- {$code this} Builder for fluent coding
-
withVariable
public <T> KernelFunctionArguments.Builder withVariable(String key, ContextVariable<T> value)
Set variable- Type Parameters:
T- Type of the value- Parameters:
key- variable namevalue- variable value- Returns:
- {$code this} Builder for fluent coding
-
withVariable
public KernelFunctionArguments.Builder withVariable(String key, Object value)
Set variable, uses the default type converters- Parameters:
key- variable namevalue- variable value- Returns:
- {$code this} Builder for fluent coding
- Throws:
SKException- if the value cannot be converted to a ContextVariable
-
withVariable
public <T> KernelFunctionArguments.Builder withVariable(String key, T value, ContextVariableTypeConverter<T> typeConverter)
Set variable- Type Parameters:
T- Type of the value- Parameters:
key- variable namevalue- variable valuetypeConverter- Type converter for the value- Returns:
- {$code this} Builder for fluent coding
- Throws:
SKException- if the value cannot be converted to a ContextVariable
-
build
public KernelFunctionArguments build()
Description copied from interface:SemanticKernelBuilderBuild the object.- Specified by:
buildin interfaceSemanticKernelBuilder<KernelFunctionArguments>- Returns:
- a constructed object.
-
-