ICopilotClient.StartConversationAsync 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
| Name | Description |
|---|---|
| StartConversationAsync(StartRequest, CancellationToken) |
Starts a new conversation with the Copilot Studio agent using a custom start request. |
| StartConversationAsync(Boolean, CancellationToken) |
Starts a conversation with Copilot Studio. |
StartConversationAsync(StartRequest, CancellationToken)
Starts a new conversation with the Copilot Studio agent using a custom start request.
public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity> StartConversationAsync(Microsoft.Agents.CopilotStudio.Client.Models.StartRequest startRequest, System.Threading.CancellationToken cancellationToken);
abstract member StartConversationAsync : Microsoft.Agents.CopilotStudio.Client.Models.StartRequest * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
Public Function StartConversationAsync (startRequest As StartRequest, cancellationToken As CancellationToken) As IAsyncEnumerable(Of IActivity)
Parameters
- startRequest
- StartRequest
Custom start request containing locale, conversation ID, and other start parameters.
- cancellationToken
- CancellationToken
Cancellation token to cancel the operation.
Returns
An async enumerable stream of activities returned by the agent during conversation initialization.
Exceptions
Thrown when startRequest is null.
Thrown when the HTTP request to Copilot Studio fails.
Thrown when the response cannot be deserialized.
Applies to
StartConversationAsync(Boolean, CancellationToken)
Starts a conversation with Copilot Studio.
public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity> StartConversationAsync(bool emitStartConversationEvent = true, System.Threading.CancellationToken cancellationToken = default);
abstract member StartConversationAsync : bool * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
Public Function StartConversationAsync (Optional emitStartConversationEvent As Boolean = true, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of IActivity)
Parameters
- emitStartConversationEvent
- Boolean
Indicates whether to ask the remote bot to emit a start event.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
An async enumerable stream of activities returned by the agent during conversation initialization.