AgentGroupChat.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(CancellationToken) |
Processes a series of interactions between the Agents that have joined this AgentGroupChat. |
InvokeAsync(Agent, CancellationToken) |
Processes a single interaction between a given Agent and an AgentGroupChat. |
InvokeAsync(CancellationToken)
Processes a series of interactions between the Agents that have joined this AgentGroupChat.
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
An asynchronous enumeration of messages.
Remarks
The interactions will proceed according to the SelectionStrategy and the TerminationStrategy defined via ExecutionSettings. In the absence of an SelectionStrategy, this method does not invoke any agents. Any agent can be explicitly selected by calling InvokeAsync(Agent, CancellationToken).
Applies to
InvokeAsync(Agent, CancellationToken)
Processes a single interaction between a given Agent and an 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
An asynchronous enumeration of messages.
Remarks
The specified agent joins the chat.