Partilhar via


KernelFunctionTerminationStrategy Class

Definition

Signals termination based on the evaluation of a KernelFunction.

public class KernelFunctionTerminationStrategy : Microsoft.SemanticKernel.Agents.Chat.TerminationStrategy
type KernelFunctionTerminationStrategy = class
    inherit TerminationStrategy
Public Class KernelFunctionTerminationStrategy
Inherits TerminationStrategy
Inheritance
KernelFunctionTerminationStrategy

Constructors

KernelFunctionTerminationStrategy(KernelFunction, Kernel)

Signals termination based on the evaluation of a KernelFunction.

Fields

DefaultAgentVariableName

The default value for AgentVariableName.

DefaultHistoryVariableName

The default value for HistoryVariableName.

DefaultMaximumIterations

Specifies a reasonable limit on the number of turns.

(Inherited from TerminationStrategy)

Properties

Agents

Gets or sets the set of agents for which this strategy is applicable.

(Inherited from TerminationStrategy)
AgentVariableName

Gets the KernelArguments key associated with the agent name when invoking Function.

Arguments

Gets optional arguments used when invoking Function.

AutomaticReset

Gets or sets a value that indicates whether IsComplete is automatically cleared if the caller proceeds with invocation subsequent to achieving termination criteria.

(Inherited from TerminationStrategy)
EvaluateNameOnly

Gets a value that indicates whether only the agent name is included in the history when invoking Function.

Function

Gets the KernelFunction invoked as termination criteria.

HistoryReducer

Gets an optional IChatHistoryReducer to reduce the history.

HistoryVariableName

Gets the KernelArguments key associated with the chat history when invoking Function.

Kernel

Gets the Kernel used when invoking Function.

Logger

Gets the ILogger associated with the TerminationStrategy.

(Inherited from TerminationStrategy)
MaximumIterations

Gets or sets the maximum number of agent interactions for a given chat invocation.

(Inherited from TerminationStrategy)
ResultParser

Gets a callback responsible for translating the FunctionResult to the termination criteria.

Methods

ShouldAgentTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

Evaluates termination once Agents is evaluated.

ShouldTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

Evaluates the input message and determines if the chat has met its completion criteria.

(Inherited from TerminationStrategy)

Applies to