RegexTerminationStrategy Class

Definition

Signals termination when the most recent message matches against the defined regular expressions for the specified agent (if provided).

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

Constructors

RegexTerminationStrategy(Regex[])

Initializes a new instance of the RegexTerminationStrategy class.

RegexTerminationStrategy(String[])

Initializes a new instance of the RegexTerminationStrategy class.

Fields

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)
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)
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)

Methods

ShouldAgentTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

Evaluates termination once Agents is evaluated.

(Inherited from TerminationStrategy)
ShouldTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

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

(Inherited from TerminationStrategy)

Applies to