CopilotClient.ExecuteAsync(String, IActivity, CancellationToken) Method

Definition

Executes an activity within the context of a specific conversation. This method ensures the activity is associated with the provided conversation ID.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity> ExecuteAsync(string conversationId, Microsoft.Agents.Core.Models.IActivity activityToSend, System.Threading.CancellationToken cancellationToken);
abstract member ExecuteAsync : string * Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
override this.ExecuteAsync : string * Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
Public Function ExecuteAsync (conversationId As String, activityToSend As IActivity, cancellationToken As CancellationToken) As IAsyncEnumerable(Of IActivity)

Parameters

conversationId
String

The conversation ID to execute the activity within. Cannot be null.

activityToSend
IActivity

The activity to send to the Copilot Studio agent. Cannot be null.

cancellationToken
CancellationToken

Cancellation token to cancel the operation.

Returns

An async enumerable stream of activities representing the agent's responses.

Implements

Applies to