Freigeben über


AgentChannel.InvokeAsync(Agent, CancellationToken) Method

Definition

Perform a discrete incremental interaction between a single Agent and AgentChat.

protected internal abstract System.Collections.Generic.IAsyncEnumerable<(bool IsVisible, Microsoft.SemanticKernel.ChatMessageContent Message)> InvokeAsync (Microsoft.SemanticKernel.Agents.Agent agent, System.Threading.CancellationToken cancellationToken = default);
abstract member InvokeAsync : Microsoft.SemanticKernel.Agents.Agent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<bool, Microsoft.SemanticKernel.ChatMessageContent>>
Protected Friend MustOverride Function InvokeAsync (agent As Agent, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ValueTuple(Of Boolean, 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

In the enumeration returned by this method, a message is considered visible if it is intended to be displayed to the user. Example of a non-visible message is function-content for functions that are automatically executed.

Applies to