ICopilotClient.AskQuestionAsync 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 |
|---|---|
| AskQuestionAsync(IActivity, CancellationToken) |
[Deprecated] Use SendActivityAsync(IActivity, CancellationToken) instead. Sends an activity to the remote bot and returns the response as an async enumerable stream of activities. |
| AskQuestionAsync(String, String, CancellationToken) |
Sends a string question to the remote bot and returns the response as an async enumerable stream of activities. |
AskQuestionAsync(IActivity, CancellationToken)
[Deprecated] Use SendActivityAsync(IActivity, CancellationToken) instead. Sends an activity to the remote bot and returns the response as an async enumerable stream of activities.
public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity> AskQuestionAsync(Microsoft.Agents.Core.Models.IActivity activity, System.Threading.CancellationToken ct = default);
abstract member AskQuestionAsync : Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
Public Function AskQuestionAsync (activity As IActivity, Optional ct As CancellationToken = Nothing) As IAsyncEnumerable(Of IActivity)
Parameters
- activity
- IActivity
The activity to send.
The cancellation token.
Returns
An async enumerable stream of activities representing the agent's responses.
Applies to
AskQuestionAsync(String, String, CancellationToken)
Sends a string question to the remote bot and returns the response as an async enumerable stream of activities.
public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity> AskQuestionAsync(string question, string? conversationId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member AskQuestionAsync : string * string * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
Public Function AskQuestionAsync (question As String, Optional conversationId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of IActivity)
Parameters
- question
- String
The question to send to the Copilot.
- conversationId
- String
The conversation ID to reference. Optional. If not set, it will use the current conversation ID.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
An async enumerable stream of activities representing the agent's responses to the question.
Exceptions
Thrown when question is null.
Thrown when the HTTP request to Copilot Studio fails.