AgentChannel<TAgent>.InvokeAsync 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
InvokeAsync(Agent, CancellationToken) |
Perform a discrete incremental interaction between a single Agent and AgentChat. |
InvokeAsync(TAgent, CancellationToken) |
Process a discrete incremental interaction between a single Agent an a AgentChat. |
InvokeAsync(Agent, CancellationToken)
protected internal override System.Collections.Generic.IAsyncEnumerable<(bool IsVisible, Microsoft.SemanticKernel.ChatMessageContent Message)> InvokeAsync (Microsoft.SemanticKernel.Agents.Agent agent, System.Threading.CancellationToken cancellationToken = default);
override this.InvokeAsync : Microsoft.SemanticKernel.Agents.Agent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<bool, Microsoft.SemanticKernel.ChatMessageContent>>
Protected Friend Overrides 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.
Applies to
InvokeAsync(TAgent, CancellationToken)
protected internal abstract System.Collections.Generic.IAsyncEnumerable<(bool IsVisible, Microsoft.SemanticKernel.ChatMessageContent Message)> InvokeAsync (TAgent agent, System.Threading.CancellationToken cancellationToken = default);
override this.InvokeAsync : 'Agent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<bool, Microsoft.SemanticKernel.ChatMessageContent>>
Protected Friend MustOverride Function InvokeAsync (agent As TAgent, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ValueTuple(Of Boolean, ChatMessageContent))
Parameters
- agent
- TAgent
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.