Share via


KernelFunctionArguments.Builder Class

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

Implements

public static class KernelFunctionArguments.Builder
implements SemanticKernelBuilder<KernelFunctionArguments>

Builder for ContextVariables

Constructor Summary

Constructor Description
Builder()

Create a new instance of Builder.

Method Summary

Modifier and Type Method and Description
Builder withInput(T content, ContextVariableTypeConverter<T> typeConverter)

Builds an instance with the given content in the default main key

Builder withInput(ContextVariable<T> content)

Builds an instance with the given content in the default main key

Builder withVariable(String key, T value, ContextVariableTypeConverter<T> typeConverter)

Set variable

Builder withVariable(String key, ContextVariable<T> value)

Set variable

KernelFunctionArguments build()

Build the object.

Builder withInput(Object content)

Builds an instance with the given content in the default main key

Builder withVariable(String key, Object value)

Set variable, uses the default type converters

Builder withVariables(Map<String,ContextVariable<?>> map)

Builds an instance with the given variables

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()

Create a new instance of Builder.

Method Details

withInput

public KernelFunctionArguments.Builder withInput(T content, ContextVariableTypeConverter typeConverter)

Builds an instance with the given content in the default main key

Parameters:

content - Entry to place in the "input" slot
typeConverter - Type converter for the content

Returns:

{$code this} Builder for fluent coding

withInput

public KernelFunctionArguments.Builder withInput(ContextVariable 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

withVariable

public KernelFunctionArguments.Builder withVariable(String key, T value, ContextVariableTypeConverter typeConverter)

Set variable

Parameters:

key - variable name
value - variable value
typeConverter - Type converter for the value

Returns:

{$code this} Builder for fluent coding

withVariable

public KernelFunctionArguments.Builder withVariable(String key, ContextVariable value)

Set variable

Parameters:

key - variable name
value - variable value

Returns:

{$code this} Builder for fluent coding

build

public KernelFunctionArguments build()

Build the object.

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

withVariable

public KernelFunctionArguments.Builder withVariable(String key, Object value)

Set variable, uses the default type converters

Parameters:

key - variable name
value - variable value

Returns:

{$code this} Builder for fluent coding

withVariables

public KernelFunctionArguments.Builder withVariables(Map> map)

Builds an instance with the given variables

Parameters:

map - Existing variables

Returns:

{$code this} Builder for fluent coding

Applies to