CompactionMessageIndex.InsertGroup 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 adds it to the Groups list at the specified index.
public Microsoft.Agents.AI.Compaction.CompactionMessageGroup InsertGroup(int index, Microsoft.Agents.AI.Compaction.CompactionGroupKind kind, System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> messages, int? turnIndex = default);
member this.InsertGroup : int * Microsoft.Agents.AI.Compaction.CompactionGroupKind * System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> * Nullable<int> -> Microsoft.Agents.AI.Compaction.CompactionMessageGroup
Public Function InsertGroup (index As Integer, kind As CompactionGroupKind, messages As IReadOnlyList(Of ChatMessage), Optional turnIndex As Nullable(Of Integer) = Nothing) As CompactionMessageGroup
Parameters
- index
- Int32
The zero-based index at which the group should be inserted.
- kind
- CompactionGroupKind
The kind of message group.
- messages
- IReadOnlyList<ChatMessage>
The messages in the group.
Returns
The newly created CompactionMessageGroup.