Share via


TurnContext.SendActivityAsync Method

Definition

Overloads

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.

SendActivityAsync(IActivity, CancellationToken)

Sends an activity to the sender of the incoming activity.

public System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse> SendActivityAsync(Microsoft.Agents.Core.Models.IActivity activity, System.Threading.CancellationToken cancellationToken = default);
abstract member SendActivityAsync : Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
override this.SendActivityAsync : Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function SendActivityAsync (activity As IActivity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

activity
IActivity

The activity to send.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

If the activity is successfully sent, the task result contains a ResourceResponse object containing the ID that the receiving channel assigned to the activity.

Implements

Applies to

SendActivityAsync(String, String, String, CancellationToken)

Sends a message activity to the sender of the incoming activity.

public System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse> SendActivityAsync(string textReplyToSend, string speak = default, string inputHint = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SendActivityAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
override this.SendActivityAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function SendActivityAsync (textReplyToSend As String, Optional speak As String = Nothing, Optional inputHint As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

textReplyToSend
String
speak
String

Optional, text to be spoken by your Agent on a speech-enabled channel.

inputHint
String

Optional, indicates whether your Agent is accepting, expecting, or ignoring user input after the message is delivered to the client. InputHints defines the possible values. Default is AcceptingInput.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

If the activity is successfully sent, the task result contains a ResourceResponse object that contains the ID that the receiving channel assigned to the activity.

See the channel's documentation for limits imposed upon the contents of text.

To control various characteristics of your Agent's speech such as voice, rate, volume, pronunciation, and pitch, specify speak in Speech Synthesis Markup Language (SSML) format.

Implements

Applies to