Share via


InvocationContext.Builder Class

  • java.lang.Object
    • com.microsoft.semantickernel.orchestration.InvocationContext.Builder

Implements

public static class InvocationContext.Builder
implements SemanticKernelBuilder<InvocationContext>

Builder for InvocationContext.

Constructor Summary

Constructor Description
Builder()

Method Summary

Modifier and Type Method and Description
InvocationContext build()

Build the object.

Builder withContextVariableConverter(ContextVariableTypeConverter<?> converter)

Add a context variable type converter to the builder.

Builder withContextVariableConverter(ContextVariableTypes contextVariableTypes)

Add a context variable type converter to the builder.

Builder withKernelHooks(KernelHooks hooks)

Add kernel hooks to the builder.

Builder withPromptExecutionSettings(PromptExecutionSettings promptExecutionSettings)

Add prompt execution settings to the builder.

Builder withReturnMode(InvocationReturnMode invocationReturnMode)

Set the return mode for the invocation.

Builder withToolCallBehavior(ToolCallBehavior toolCallBehavior)

Add tool call behavior to the builder.

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

build

public InvocationContext build()

Build the object.

withContextVariableConverter

public InvocationContext.Builder withContextVariableConverter(ContextVariableTypeConverter converter)

Add a context variable type converter to the builder.

Parameters:

converter - the converter to add.

Returns:

this Builder

withContextVariableConverter

public InvocationContext.Builder withContextVariableConverter(ContextVariableTypes contextVariableTypes)

Add a context variable type converter to the builder.

Parameters:

contextVariableTypes - the context variable types to add.

Returns:

this Builder

withKernelHooks

public InvocationContext.Builder withKernelHooks(KernelHooks hooks)

Add kernel hooks to the builder.

Parameters:

hooks - the hooks to add.

Returns:

this Builder

withPromptExecutionSettings

public InvocationContext.Builder withPromptExecutionSettings(PromptExecutionSettings promptExecutionSettings)

Add prompt execution settings to the builder.

Parameters:

promptExecutionSettings - the settings to add.

Returns:

this Builder

withReturnMode

public InvocationContext.Builder withReturnMode(InvocationReturnMode invocationReturnMode)

Set the return mode for the invocation.

Defaults to NEW_MESSAGES_ONLY.

Parameters:

invocationReturnMode - the return mode for the invocation.

Returns:

this Builder

withToolCallBehavior

public InvocationContext.Builder withToolCallBehavior(ToolCallBehavior toolCallBehavior)

Add tool call behavior to the builder.

Parameters:

toolCallBehavior - the behavior to add.

Returns:

this Builder

Applies to