共用方式為


AgentGroupChat.InvokeStreamingAsync Method

Definition

Overloads

InvokeStreamingAsync(CancellationToken)

Processes a series of interactions between the Agents that have joined this AgentGroupChat.

InvokeStreamingAsync(Agent, CancellationToken)

Processes a single interaction between a given Agent and an AgentGroupChat.

InvokeStreamingAsync(CancellationToken)

Processes a series of interactions between the Agents that have joined this AgentGroupChat.

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

Parameters

cancellationToken
CancellationToken

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

Returns

An asynchronous enumeration of streaming 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

InvokeStreamingAsync(Agent, CancellationToken)

Processes a single interaction between a given Agent and an AgentGroupChat.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.StreamingChatMessageContent> InvokeStreamingAsync(Microsoft.SemanticKernel.Agents.Agent agent, System.Threading.CancellationToken cancellationToken = default);
override this.InvokeStreamingAsync : Microsoft.SemanticKernel.Agents.Agent * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.StreamingChatMessageContent>
Public Function InvokeStreamingAsync (agent As Agent, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of StreamingChatMessageContent)

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.

Applies to