CompactionMessageIndex.AddGroup Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
Returns
The newly created CompactionMessageGroup.