Partager via


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

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

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

(Inherited from TerminationStrategy)
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)

Methods

ShouldAgentTerminateAsync(Agent, IReadOnlyList<ChatMessageContent>, CancellationToken)

Called to evaluate termination once Agents is evaluated.

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

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

(Inherited from TerminationStrategy)

Applies to