ITurnContext.SendActivityAsync Method
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.
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>
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.
See also
- OnSendActivities(SendActivitiesHandler)
- SendActivityAsync(String, String, String, CancellationToken)
- SendActivitiesAsync(IActivity[], CancellationToken)
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 text, string speak = default, string inputHint = "acceptingInput", System.Threading.CancellationToken cancellationToken = default);
abstract member SendActivityAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function SendActivityAsync (text As String, Optional speak As String = Nothing, Optional inputHint As String = "acceptingInput", Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)
Parameters
- text
- String
The text of the message to send.
- 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.
See also
- OnSendActivities(SendActivitiesHandler)
- SendActivityAsync(IActivity, CancellationToken)
- SendActivitiesAsync(IActivity[], CancellationToken)