CopilotClient.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) |
Obsolete.
Sends an activity the remote bot and returns the response as an IAsyncEnumerable of IActivity |
| AskQuestionAsync(String, String, CancellationToken) |
Sends a String question to the remote bot and returns the response as an IAsyncEnumerable of IActivity |
AskQuestionAsync(IActivity, CancellationToken)
Caution
AskQuestionAsync(IActivity, CancellationToken) is deprecated. Use SendActivityAsync(IActivity, CancellationToken) instead.
Sends an activity the remote bot and returns the response as an IAsyncEnumerable of IActivity
[System.Obsolete("AskQuestionAsync(IActivity, CancellationToken) is deprecated. Use SendActivityAsync(IActivity, CancellationToken) instead.", false)]
public System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity> AskQuestionAsync(Microsoft.Agents.Core.Models.IActivity activity, System.Threading.CancellationToken ct = default);
[<System.Obsolete("AskQuestionAsync(IActivity, CancellationToken) is deprecated. Use SendActivityAsync(IActivity, CancellationToken) instead.", false)>]
abstract member AskQuestionAsync : Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.Core.Models.IActivity>
override this.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
Activity to send
Event Cancelation Token
Returns
An async enumerable stream of activities representing the agent's responses.
Implements
- Attributes
Applies to
AskQuestionAsync(String, String, CancellationToken)
Sends a String question to the remote bot and returns the response as an IAsyncEnumerable of IActivity
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>
override this.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
String Question to send to copilot
- conversationId
- String
Conversation ID to reference, Optional. If not set it will pick up the current conversation id
- cancellationToken
- CancellationToken
The cancellation token.
Returns
An async enumerable stream of activities representing the agent's responses to the question.