Partager via


AgentGroupChat.InvokeAsync Method

Definition

Overloads

InvokeAsync(CancellationToken)

Process a series of interactions between the Agents that have joined this AgentGroupChat. The interactions will proceed according to the SelectionStrategy and the TerminationStrategy defined via ExecutionSettings. In the absence of an SelectionStrategy, this method will not invoke any agents. Any agent may be explicitly selected by calling InvokeAsync(Agent, CancellationToken).

InvokeAsync(Agent, CancellationToken)

Process a single interaction between a given Agent an a AgentGroupChat.

InvokeAsync(CancellationToken)

Process a series of interactions between the Agents that have joined this AgentGroupChat. The interactions will proceed according to the SelectionStrategy and the TerminationStrategy defined via ExecutionSettings. In the absence of an SelectionStrategy, this method will not invoke any agents. Any agent may be explicitly selected by calling InvokeAsync(Agent, CancellationToken).

public override System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> InvokeAsync (System.Threading.CancellationToken cancellationToken = default);
override this.InvokeAsync : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent>
Public Overrides Function InvokeAsync (Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatMessageContent)

Parameters

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

Asynchronous enumeration of messages.

Applies to

InvokeAsync(Agent, CancellationToken)

Process a single interaction between a given Agent an a AgentGroupChat.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> 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<Microsoft.SemanticKernel.ChatMessageContent>
Public Function InvokeAsync (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.

Applies to