共用方式為


AgentGroupChat Class

Definition

A an AgentChat that supports multi-turn interactions.

public sealed class AgentGroupChat : Microsoft.SemanticKernel.Agents.AgentChat
type AgentGroupChat = class
    inherit AgentChat
Public NotInheritable Class AgentGroupChat
Inherits AgentChat
Inheritance
AgentGroupChat

Constructors

AgentGroupChat(Agent[])

Initializes a new instance of the AgentGroupChat class.

Properties

Agents

The agents participating in the chat.

ExecutionSettings

Settings for defining chat behavior.

History

Exposes the internal history to subclasses.

(Inherited from AgentChat)
IsActive

Indicates if a chat operation is active. Activity is defined as any the execution of any public method.

(Inherited from AgentChat)
IsComplete

Indicates if completion criteria has been met. If set, no further agent interactions will occur. Clear to enable more agent interactions.

Logger

The ILogger associated with this chat.

(Inherited from AgentChat)
LoggerFactory

The ILoggerFactory associated with the AgentChat.

(Inherited from AgentChat)

Methods

AddAgent(Agent)

Add a Agent to the chat.

AddChatMessage(ChatMessageContent)

Append a message to the conversation. Adding a message while an agent is active is not allowed.

(Inherited from AgentChat)
AddChatMessages(IReadOnlyList<ChatMessageContent>)

Append messages to the conversation. Adding messages while an agent is active is not allowed.

(Inherited from AgentChat)
GetChatMessagesAsync(Agent, CancellationToken)

Retrieve the message history, either the primary history or an agent specific version.

(Inherited from AgentChat)
GetChatMessagesAsync(CancellationToken)

Retrieve the chat history.

(Inherited from AgentChat)
InvokeAgentAsync(Agent, CancellationToken)

Process a discrete incremental interaction between a single Agent an a AgentChat.

(Inherited from AgentChat)
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).

InvokeStreamingAgentAsync(Agent, CancellationToken)

Process a discrete incremental interaction between a single Agent an a AgentChat.

(Inherited from AgentChat)
InvokeStreamingAsync(Agent, CancellationToken)

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

InvokeStreamingAsync(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).

ResetAsync(CancellationToken)

Reset the chat, clearing all history and persisted state. All agents will remain present.

(Inherited from AgentChat)
SetActivityOrThrow()

Test to ensure chat is not concurrently active and throw exception if it is. If not, activity is signaled.

(Inherited from AgentChat)

Applies to