Share via


AgentChat.AddChatMessage(ChatMessageContent) Method

Definition

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

public void AddChatMessage(Microsoft.SemanticKernel.ChatMessageContent message);
member this.AddChatMessage : Microsoft.SemanticKernel.ChatMessageContent -> unit
Public Sub AddChatMessage (message As ChatMessageContent)

Parameters

message
ChatMessageContent

A non-system message to append to the conversation.

Exceptions

A system message is present, and no other action is taken.

Remarks

Adding a message to the conversation requires that any active AgentChannel remains synchronized, so the message is broadcast to all channels.

AgentChat instances don't support concurrent invocation and will throw exception if concurrent activity is attempted.

Applies to