共用方式為


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

Restrict number of turns to a reasonable number (99).

(Inherited from TerminationStrategy)

Properties

Agents

Set of agents for which this strategy is applicable. If not set, any agent is evaluated.

(Inherited from TerminationStrategy)
AgentVariableName

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

Arguments

Optional arguments used when invoking Function.

AutomaticReset

Set to have automatically clear IsComplete if caller proceeds with invocation subsequent to achieving termination criteria.

(Inherited from TerminationStrategy)
Function

The KernelFunction invoked as termination criteria.

HistoryVariableName

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

Kernel

The Kernel used when invoking Function.

Logger

The ILogger associated with the TerminationStrategy.

(Inherited from TerminationStrategy)
MaximumIterations

The maximum number of agent interactions for a given chat invocation. Defaults to: DefaultMaximumIterations.

(Inherited from TerminationStrategy)
ResultParser

A callback responsible for translating the FunctionResult to the termination criteria.

Methods

ShouldAgentTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

Called to evaluate termination once Agents is evaluated.

ShouldTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

Evaluate the input message and determine if the chat has met its completion criteria.

(Inherited from TerminationStrategy)

Applies to