ConversationUpdateRouteAttribute(String, Boolean, UInt16, String) Constructor

Definition

Attribute to define a route that handles conversation update activities, optionally matching a specific event.

public ConversationUpdateRouteAttribute(string eventName = default, bool isAgenticOnly = false, ushort rank = 32767, string autoSignInHandlers = default);
new Microsoft.Agents.Builder.App.ConversationUpdateRouteAttribute : string * bool * uint16 * string -> Microsoft.Agents.Builder.App.ConversationUpdateRouteAttribute
Public Sub New (Optional eventName As String = Nothing, Optional isAgenticOnly As Boolean = false, Optional rank As UShort = 32767, Optional autoSignInHandlers As String = Nothing)

Parameters

eventName
String

A ConversationUpdateEvents value to match. Only MembersAdded and MembersRemoved receive specific matching logic; any other value matches all conversationUpdate activities. When omitted, all conversation update activities are matched and the route defaults to Last. Prefer MembersAddedRouteAttribute or MembersRemovedRouteAttribute for member events.

isAgenticOnly
Boolean

When true, the route only fires for agentic turns. Defaults to false.

rank
UInt16

Route evaluation order. Lower values run first. Defaults to Unspecified.

autoSignInHandlers
String

A comma/space/semicolon-delimited list of OAuth sign-in handler names, or the name of an instance or static method on the agent class matching Func<ITurnContext, string[]>.

Remarks

Decorate a method with this attribute to register it as a handler for conversation update activities. When eventName is provided, it is matched against ConversationUpdateEvents values. When omitted, all conversation update activities are matched. Use MembersAddedRouteAttribute or MembersRemovedRouteAttribute for the common member events. The method must match the RouteHandler delegate signature.

// Match any conversation update
[ConversationUpdateRoute]
public async Task OnConversationUpdateAsync(ITurnContext turnContext, ITurnState turnState, CancellationToken cancellationToken)
{
    // Handle any conversation update
}

Applies to