TurnContextWrapper Class
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.
Provides a base wrapper around an ITurnContext instance.
public abstract class TurnContextWrapper : Microsoft.Agents.Builder.ITurnContext
type TurnContextWrapper = class
interface ITurnContext
Public MustInherit Class TurnContextWrapper
Implements ITurnContext
- Inheritance
-
TurnContextWrapper
- Implements
Remarks
This class delegates all ITurnContext members to an inner turn context, allowing derived types to extend turn-context behavior without reimplementing the underlying operations.
Constructors
| Name | Description |
|---|---|
| TurnContextWrapper(ITurnContext) |
Initializes a new instance of the TurnContextWrapper class. |
Fields
| Name | Description |
|---|---|
| _turnContext | |
Properties
| Name | Description |
|---|---|
| Activity |
Gets the activity associated with this turn; or |
| Adapter |
Gets the Adapter that created this context object. |
| Identity |
Gets the claims identity associated with this turn context. |
| Responded |
Gets a value indicating whether at least one response was sent for the current turn. |
| Services |
Gets the services registered on this context object. |
| StackState |
Gets the state collection for the turn context. |
| StreamingResponse |
Provides access to the IStreamingResponse to allow streaming of chunked messages (for example, via streaming AI responses). |
Methods
| Name | Description |
|---|---|
| DeleteActivityAsync(ConversationReference, CancellationToken) |
Deletes an existing activity. |
| DeleteActivityAsync(String, CancellationToken) |
Deletes an existing activity. |
| OnDeleteActivity(DeleteActivityHandler) |
Adds a response handler for delete activity operations. |
| OnSendActivities(SendActivitiesHandler) |
Adds a response handler for send activity operations. |
| OnUpdateActivity(UpdateActivityHandler) |
Adds a response handler for update activity operations. |
| SendActivitiesAsync(IActivity[], CancellationToken) |
Sends a set of activities to the sender of the incoming activity. |
| SendActivityAsync(IActivity, CancellationToken) |
Sends an activity to the sender of the incoming activity. |
| SendActivityAsync(String, String, String, CancellationToken) |
Sends a message activity to the sender of the incoming activity. |
| TraceActivityAsync(String, Object, String, String, CancellationToken) |
Sends a trace activity to the IChannelAdapter for logging purposes. |
| UpdateActivityAsync(IActivity, CancellationToken) |
Replaces an existing activity. |
Extension Methods
| Name | Description |
|---|---|
| ExchangeTurnTokenAsync(ITurnContext, String, String, IList<String>, CancellationToken) | |
| GetDebugger(ITurnContext) |
Extension method to get IDialogDebugger from TurnContext. |
| GetTurnTokenAsync(ITurnContext, String, CancellationToken) | |
| GetTurnTokens(ITurnContext) | |
| IsAgenticRequest(ITurnContext) | |