IOrchestratedClient.ExecuteTurnAsync 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.
Executes an orchestrated turn with a custom request. This is the low-level method that all other methods delegate to.
public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.CopilotStudio.Client.Models.OrchestratedResponse> ExecuteTurnAsync(string conversationId, Microsoft.Agents.CopilotStudio.Client.Models.OrchestratedTurnRequest request, Microsoft.Agents.CopilotStudio.Client.Models.RequestProperties? requestProperties = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ExecuteTurnAsync : string * Microsoft.Agents.CopilotStudio.Client.Models.OrchestratedTurnRequest * Microsoft.Agents.CopilotStudio.Client.Models.RequestProperties * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.CopilotStudio.Client.Models.OrchestratedResponse>
Public Function ExecuteTurnAsync (conversationId As String, request As OrchestratedTurnRequest, Optional requestProperties As RequestProperties = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of OrchestratedResponse)
Parameters
- conversationId
- String
The conversation ID.
- request
- OrchestratedTurnRequest
The orchestrated turn request to send.
- requestProperties
- RequestProperties
Optional properties mapped to HTTP request headers.
- cancellationToken
- CancellationToken
Cancellation token to cancel the operation.
Returns
An async enumerable stream of orchestrated responses from the copilot.
Exceptions
Thrown when conversationId or request is null.
Thrown when the HTTP request fails.
Thrown when the response cannot be deserialized.