ITurnContext<T> Interface
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 context for a turn of an Agent, where the context's Activity property is strongly typed.
public interface ITurnContext<T> : Microsoft.Agents.Builder.ITurnContext where T : IActivity
type ITurnContext<'T (requires 'T :> IActivity)> = interface
interface ITurnContext
Public Interface ITurnContext(Of T)
Implements ITurnContext
Type Parameters
- T
The activity type for this turn of the Agent.
- Implements
Remarks
The IActivity interface defines properties shared by every type of activity. The interfaces that derive from IActivity include properties specific to a specific <seealso cref="T:Microsoft.Agents.Core.Models.IActivity"></seealso><seealso cref="T:Microsoft.Agents.Builder.IAgent"></seealso><seealso cref="T:Microsoft.Agents.Builder.ITurnContext"></seealso>
Properties
| Activity |
Gets the activity for this turn of the Agent. |
| Adapter |
Gets the Adapter that created this context object. (Inherited from ITurnContext) |
| Identity | (Inherited from ITurnContext) |
| Responded |
Gets a value indicating whether at least one response was sent for the current turn. (Inherited from ITurnContext) |
| Services | (Inherited from ITurnContext) |
| StackState | (Inherited from ITurnContext) |
| StreamingResponse |
Provides access to the IStreamingResponse to allow streaming of chunked messages (for example, via streaming AI responses). (Inherited from ITurnContext) |
Methods
| DeleteActivityAsync(ConversationReference, CancellationToken) |
Deletes an existing activity. (Inherited from ITurnContext) |
| DeleteActivityAsync(String, CancellationToken) |
Deletes an existing activity. (Inherited from ITurnContext) |
| OnDeleteActivity(DeleteActivityHandler) |
Adds a response handler for delete activity operations. (Inherited from ITurnContext) |
| OnSendActivities(SendActivitiesHandler) |
Adds a response handler for send activity operations. (Inherited from ITurnContext) |
| OnUpdateActivity(UpdateActivityHandler) |
Adds a response handler for update activity operations. (Inherited from ITurnContext) |
| SendActivitiesAsync(IActivity[], CancellationToken) |
Sends a set of activities to the sender of the incoming activity. (Inherited from ITurnContext) |
| SendActivityAsync(IActivity, CancellationToken) |
Sends an activity to the sender of the incoming activity. (Inherited from ITurnContext) |
| SendActivityAsync(String, String, String, CancellationToken) |
Sends a message activity to the sender of the incoming activity. (Inherited from ITurnContext) |
| TraceActivityAsync(String, Object, String, String, CancellationToken) |
Sends a trace activity to the IChannelAdapter for logging purposes. (Inherited from ITurnContext) |
| UpdateActivityAsync(IActivity, CancellationToken) |
Replaces an existing activity. (Inherited from ITurnContext) |
Extension Methods
| GetDebugger(ITurnContext) |
Extension method to get IDialogDebugger from TurnContext. |