Class InvocationContext
- java.lang.Object
-
- com.microsoft.semantickernel.orchestration.InvocationContext
-
public class InvocationContext extends Object
Context passed to a Kernel or KernelFunction invoke. This class is primarily for internal use. The preferred way to supply a context is to use the discrete "with" methods inFunctionInvocation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInvocationContext.BuilderBuilder forInvocationContext.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InvocationContext.Builderbuilder()Create a newInvocationContext.Builderfor building an instance ofInvocationContext.static InvocationContext.Buildercopy(InvocationContext context)Create a new instance of InvocationContext by copying the values from another instance.ContextVariableTypesgetContextVariableTypes()Get the types of context variables.KernelHooks.UnmodifiableKernelHooksgetKernelHooks()Get the hooks to use for the invocation.PromptExecutionSettingsgetPromptExecutionSettings()Get the settings for prompt execution.ToolCallBehaviorgetToolCallBehavior()Get the behavior for tool calls.InvocationReturnModereturnMode()Get the return mode for the invocation.
-
-
-
Method Detail
-
builder
public static InvocationContext.Builder builder()
Create a newInvocationContext.Builderfor building an instance ofInvocationContext.- Returns:
- the new Builder.
-
copy
public static InvocationContext.Builder copy(InvocationContext context)
Create a new instance of InvocationContext by copying the values from another instance.- Parameters:
context- The context to copy.- Returns:
- The new instance of InvocationContext.
-
getKernelHooks
@Nullable public KernelHooks.UnmodifiableKernelHooks getKernelHooks()
Get the hooks to use for the invocation.- Returns:
- The hooks to use for the invocation.
-
getPromptExecutionSettings
@Nullable public PromptExecutionSettings getPromptExecutionSettings()
Get the settings for prompt execution.- Returns:
- The settings for prompt execution.
-
getToolCallBehavior
@Nullable public ToolCallBehavior getToolCallBehavior()
Get the behavior for tool calls.- Returns:
- The behavior for tool calls.
-
getContextVariableTypes
public ContextVariableTypes getContextVariableTypes()
Get the types of context variables.- Returns:
- The types of context variables.
-
returnMode
public InvocationReturnMode returnMode()
Get the return mode for the invocation.- Returns:
- this
InvocationContext.Builder
-
-