CompactionMessageIndex.AddGroup Method

Definition

Creates a new CompactionMessageGroup with byte and token counts computed using this collection's Tokenizer, and appends it to the end of the Groups list.

public Microsoft.Agents.AI.Compaction.CompactionMessageGroup AddGroup(Microsoft.Agents.AI.Compaction.CompactionGroupKind kind, System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> messages, int? turnIndex = default);
member this.AddGroup : Microsoft.Agents.AI.Compaction.CompactionGroupKind * System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> * Nullable<int> -> Microsoft.Agents.AI.Compaction.CompactionMessageGroup
Public Function AddGroup (kind As CompactionGroupKind, messages As IReadOnlyList(Of ChatMessage), Optional turnIndex As Nullable(Of Integer) = Nothing) As CompactionMessageGroup

Parameters

kind
CompactionGroupKind

The kind of message group.

messages
IReadOnlyList<ChatMessage>

The messages in the group.

turnIndex
Nullable<Int32>

The optional turn index to assign to the new group.

Returns

The newly created CompactionMessageGroup.

Applies to