Share via


ITurnContext Interface

Definition

Provides context for a turn of an Agent.

public interface ITurnContext
type ITurnContext = interface
Public Interface ITurnContext
Derived

Remarks

Context provides information needed to process an incoming IActivity. The context object is created by a IChannelAdapter and persists for the length of the turn.

Properties

Activity

Gets the Activity for this Turn. This is the incoming IActivity.

Adapter

Gets the Adapter that created this context object.

Identity
Responded

Gets a value indicating whether at least one response was sent for the current turn.

Services
StackState
StreamingResponse

Provides access to the IStreamingResponse to allow streaming of chunked messages (for example, via streaming AI responses).

Methods

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

GetDebugger(ITurnContext)

Extension method to get IDialogDebugger from TurnContext.

Applies to

See also