Share via


AutoFunctionInvocationContext Class

Definition

Class with data related to automatic function invocation.

public class AutoFunctionInvocationContext
type AutoFunctionInvocationContext = class
Public Class AutoFunctionInvocationContext
Inheritance
AutoFunctionInvocationContext

Constructors

AutoFunctionInvocationContext(Kernel, KernelFunction, FunctionResult, ChatHistory, ChatMessageContent)

Initializes a new instance of the AutoFunctionInvocationContext class.

Properties

Arguments

Gets the arguments associated with the operation.

CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

ChatHistory

Gets the ChatHistory associated with automatic function invocation.

ChatMessageContent

The chat message content associated with automatic function invocation.

ExecutionSettings

The execution settings associated with the operation.

Function

Gets the KernelFunction with which this filter is associated.

FunctionCount

Number of functions that will be invoked during auto function invocation request.

FunctionSequenceIndex

Function sequence index. Starts from 0.

IsStreaming

Boolean flag which indicates whether a filter is invoked within streaming or non-streaming mode.

Kernel

Gets the Kernel containing services, plugins, and other state for use throughout the operation.

RequestSequenceIndex

Request sequence index of automatic function invocation process. Starts from 0.

Result

Gets or sets the result of the function's invocation.

Terminate

Gets or sets a value indicating whether the operation associated with the filter should be terminated.

By default, this value is false, which means all functions will be invoked. If set to true, the behavior depends on how functions are invoked:

  • If functions are invoked sequentially (the default behavior), the remaining functions will not be invoked, and the last request to the LLM will not be performed.

  • If functions are invoked concurrently (controlled by the AllowConcurrentInvocation option), other functions will still be invoked, and the last request to the LLM will not be performed.

In both cases, the automatic function invocation process will be terminated, and the result of the last executed function will be returned to the caller.

ToolCallId

The ID of the tool call.

Applies to