ActionExecuteRouteAttribute(String, String, Boolean, UInt16, String) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Attribute to define a route that handles Adaptive Card Action.Execute invoke activities, optionally
matching a specific verb or verb pattern.
public ActionExecuteRouteAttribute(string verb = default, string verbRegex = default, bool isAgenticOnly = false, ushort rank = 32767, string autoSignInHandlers = default);
new Microsoft.Agents.Builder.App.AdaptiveCards.ActionExecuteRouteAttribute : string * string * bool * uint16 * string -> Microsoft.Agents.Builder.App.AdaptiveCards.ActionExecuteRouteAttribute
Public Sub New (Optional verb As String = Nothing, Optional verbRegex As String = Nothing, Optional isAgenticOnly As Boolean = false, Optional rank As UShort = 32767, Optional autoSignInHandlers As String = Nothing)
Parameters
- verb
- String
The exact verb to match. Mutually exclusive with verbRegex. When both are omitted, all verbs are matched.
- verbRegex
- String
A regular expression pattern matched against the Action.Execute verb. Mutually exclusive with verb.
- 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 Adaptive Card Action.Execute events. Provide verb for an exact match, verbRegex for a pattern match, or neither to match any verb. verb and verbRegex are mutually exclusive. The method must match the ActionExecuteHandler delegate signature.
[ActionExecuteRoute("doStuff")]
public async Task<AdaptiveCardInvokeResponse> OnDoStuffAsync(ITurnContext turnContext, ITurnState turnState, object data, CancellationToken cancellationToken)
{
// Handle Action.Execute with verb "doStuff"
}