ภาษา

TeamsTaskFetchRouteAttribute(String, String, Boolean, UInt16, String) Constructor

Definition

Attribute to define a route that handles Teams task module fetch events. The decorated method must match the TaskFetchHandler delegate signature — the third parameter must be Microsoft.Teams.Api.TaskModules.Request.

public TeamsTaskFetchRouteAttribute(string value = default, string key = default, bool isAgenticOnly = false, ushort rank = 32767, string signInHandlers = default);
new Microsoft.Agents.Extensions.MSTeams.TaskModules.TeamsTaskFetchRouteAttribute : string * string * bool * uint16 * string -> Microsoft.Agents.Extensions.MSTeams.TaskModules.TeamsTaskFetchRouteAttribute
Public Sub New (Optional value As String = Nothing, Optional key As String = Nothing, Optional isAgenticOnly As Boolean = false, Optional rank As UShort = 32767, Optional signInHandlers As String = Nothing)

Parameters

value
String

The task module key value to match. If null this will match for any fetch request.

key
String

The JSON field name used to identify the key in the task data. Defaults to "task" if not specified.

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.

signInHandlers
String

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

Remarks

Decorate a method with this attribute to register it as a handler for Teams task module fetch events.

[TeamsTaskFetchRoute("myKey")]
public async Task<Microsoft.Teams.Api.TaskModules.Response> OnFetchAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Api.TaskModules.Request request, CancellationToken cancellationToken)
{
    // Handle task module fetch event
}

Alternatively, OnFetch(String, TaskFetchHandler, String, String[], UInt16) can be used to register the handler via the fluent API.

Applies to