Partilhar via


TeamsApplication Class

Definition

Represents a Teams application that can be used to build and deploy intelligent agents within Microsoft Teams.

public class TeamsApplication : Microsoft.Agents.Builder.App.AgentApplication
type TeamsApplication = class
    inherit AgentApplication
Public Class TeamsApplication
Inherits AgentApplication
Inheritance
TeamsApplication

Constructors

TeamsApplication(TeamsAgentApplicationOptions)

Initializes a new instance of the TeamsApplication class with the specified options.

Properties

AdaptiveCards

Fluent interface for accessing Adaptive Card specific features.

(Inherited from AgentApplication)
AI

Fluent interface for accessing AI specific features.

Meetings

Gets the meeting for the Teams application.

MessageExtensions

Gets the message extensions for the Teams application.

Options

The application's configured options.

(Inherited from AgentApplication)
RegisteredExtensions (Inherited from AgentApplication)
TaskModules

Gets the task modules for the Teams application.

UserAuthorization

Accessing user authorization features.

(Inherited from AgentApplication)

Methods

AddRoute(RouteSelector, RouteHandler, Boolean, UInt16, String[])

Adds a new route to the application.

Developers won't typically need to call this method directly as it's used internally by all of the fluent interfaces to register routes for their specific activity types.

Routes will be matched in the order they're added to the application. The first selector to return true when an activity is received will have its handler called.

Invoke-based activities receive special treatment and are matched separately as they typically have shorter execution timeouts.

(Inherited from AgentApplication)
OnActivity(MultipleRouteSelector, RouteHandler, UInt16, String[])

Handles incoming activities of a given type.

(Inherited from AgentApplication)
OnActivity(Regex, RouteHandler, UInt16, String[])

Handles incoming activities of a given type.

(Inherited from AgentApplication)
OnActivity(RouteSelector, RouteHandler, UInt16, String[])

Handles incoming activities of a given type.

(Inherited from AgentApplication)
OnActivity(String, RouteHandler, UInt16, String[])

Handles incoming activities of a given type.

(Inherited from AgentApplication)
OnAfterTurn(TurnEventHandler)

Add a handler that will execute after the turn's activity handler logic is processed.
Handler returns true to finish execution of the current turn. Handler returning false prevents the Agents state from being saved.

(Inherited from AgentApplication)
OnBeforeTurn(TurnEventHandler)

Add a handler that will execute before the turn's activity handler logic is processed.
Handler returns true to continue execution of the current turn. Handler returning false prevents the turn from running, but the Agents state is still saved, which lets you track the reason why the turn was not processed. It also means you can use this as a way to call into the dialog system. For example, you could use the OAuthPrompt to sign the user in before allowing the AI system to run.

(Inherited from AgentApplication)
OnConversationUpdate(RouteSelector, RouteHandler, UInt16, String[])

Handles conversation update events using a custom selector.

(Inherited from AgentApplication)
OnConversationUpdate(String, RouteHandler, UInt16, String[])

Handles conversation update events.

(Inherited from AgentApplication)
OnConversationUpdate(String[], RouteHandler, UInt16, String[])

Handles conversation update events.

(Inherited from AgentApplication)
OnEvent(Regex, RouteHandler, UInt16, String[])

Handles incoming Events matching a Name pattern.

(Inherited from AgentApplication)
OnEvent(RouteSelector, RouteHandler, UInt16, String[])

Handles incoming Events.

(Inherited from AgentApplication)
OnEvent(String, RouteHandler, UInt16, String[])

Handles incoming Event with a specific Name.

(Inherited from AgentApplication)
OnHandoff(HandoffHandler, UInt16, String[])

Handles handoff activities.

(Inherited from AgentApplication)
OnMessage(MultipleRouteSelector, RouteHandler, UInt16, String[])

Handles incoming messages with a given keyword.
This method provides a simple way to have a Agent respond anytime a user sends a message with a specific word or phrase.

(Inherited from AgentApplication)
OnMessage(Regex, RouteHandler, UInt16, String[])

Handles incoming messages with a given keyword.
This method provides a simple way to have a Agent respond anytime a user sends a message with a specific word or phrase.
For example, you can easily clear the current conversation anytime a user sends "/reset":
application.OnMessage(new Regex("reset"), (context, turnState, _) => ...);

(Inherited from AgentApplication)
OnMessage(RouteSelector, RouteHandler, UInt16, String[])

Handles incoming messages with a given keyword.
This method provides a simple way to have a Agent respond anytime a user sends a message with a specific word or phrase.

(Inherited from AgentApplication)
OnMessage(String, RouteHandler, UInt16, String[])

Handles incoming messages with a given keyword.
This method provides a simple way to have an Agent respond anytime a user sends a message with a specific word or phrase.
For example, you can easily clear the current conversation anytime a user sends "/reset":
application.OnMessage("/reset", (context, turnState, _) => ...);

(Inherited from AgentApplication)
OnMessageReactionsAdded(RouteHandler, UInt16, String[])

Handles message reactions added events.

(Inherited from AgentApplication)
OnMessageReactionsRemoved(RouteHandler, UInt16, String[])

Handles message reactions removed events.

(Inherited from AgentApplication)
OnTurnAsync(ITurnContext, CancellationToken)

Called by the adapter (for example, a CloudAdapter) at runtime in order to process an inbound Activity.

(Inherited from AgentApplication)
OnTurnError(AgentApplicationTurnError)

Allows the AgentApplication to provide error handling without having to change the Adapter.OnTurnError. This is beneficial since the application has more context.

(Inherited from AgentApplication)
RegisterExtension<TExtension>(TExtension, Action<TExtension>)

Registers extension with application, providing callback to specify extension features.

(Inherited from AgentApplication)
StartTypingTimer(ITurnContext)

Manually start a timer to periodically send "typing" activities.

(Inherited from AgentApplication)
StopTypingTimer()

Manually stop the typing timer.

(Inherited from AgentApplication)

Applies to