AgentChat.AddChatMessages(IReadOnlyList<ChatMessageContent>) Method

Definition

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

public void AddChatMessages(System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> messages);
member this.AddChatMessages : System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> -> unit
Public Sub AddChatMessages (messages As IReadOnlyList(Of ChatMessageContent))

Parameters

messages
IReadOnlyList<ChatMessageContent>

A set of non-system messages to append to the conversation.

Exceptions

A system message is present, and no other action is taken. -or- The chat has current activity.

Remarks

Adding messages to the conversation requires that any active AgentChannel remains synchronized, so the messages are broadcast to all channels.

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

Applies to