AgentChat.InvokeAgentAsync(Agent, CancellationToken) 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.
protected System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> InvokeAgentAsync (Microsoft.SemanticKernel.Agents.Agent agent, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeAgentAsync : Microsoft.SemanticKernel.Agents.Agent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent>
Protected Function InvokeAgentAsync (agent As Agent, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatMessageContent)
Parameters
- agent
- Agent
The agent actively interacting with the chat.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
Asynchronous enumeration of messages.
Remarks
Any AgentChat instance does not support concurrent invocation and will throw exception if concurrent activity is attempted.