共用方式為


AgentChat Class

Definition

Point of interaction for one or more agents.

public abstract class AgentChat
type AgentChat = class
Public MustInherit Class AgentChat
Inheritance
AgentChat
Derived

Remarks

Any AgentChat instance does not support concurrent invocation and will throw exception if concurrent activity is attempted for any public method.

Constructors

AgentChat()

Initializes a new instance of the AgentChat class.

Properties

History

Exposes the internal history to subclasses.

IsActive

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

Logger

The ILogger associated with this chat.

LoggerFactory

The ILoggerFactory associated with the AgentChat.

Methods

AddChatMessage(ChatMessageContent)

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

AddChatMessages(IReadOnlyList<ChatMessageContent>)

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

GetChatMessagesAsync(Agent, CancellationToken)

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

GetChatMessagesAsync(CancellationToken)

Retrieve the chat history.

InvokeAgentAsync(Agent, CancellationToken)

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

InvokeAsync(CancellationToken)

Process a series of interactions between the agents participating in this chat.

InvokeStreamingAgentAsync(Agent, CancellationToken)

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

InvokeStreamingAsync(CancellationToken)

Process a series of interactions between the agents participating in this chat.

ResetAsync(CancellationToken)

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

SetActivityOrThrow()

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

Applies to