Struct ChatHistory.Message.MessageSegment
- Namespace
- LMKit.TextGeneration.Chat
- Assembly
- LM-Kit.NET.dll
Represents a contiguous slice of Content with its TextSegmentType.
public readonly struct ChatHistory.Message.MessageSegment
- Inherited Members
Examples
Iterating over message segments:
using LMKit.TextGeneration.Chat;
ChatHistory.Message message = conversation.ChatHistory.Messages.Last();
foreach (ChatHistory.Message.MessageSegment seg in message.Segments)
{
Console.WriteLine($"[{seg.SegmentType}] offset={seg.Start} len={seg.Length}");
Console.WriteLine(seg.Content);
}
Properties
- Content
Gets the segment text as a materialized string.
- Length
Gets the length, in characters, of this segment.
- SegmentType
Gets the segment classification applied to this slice of content.
Methods
- ToString()
Returns the segment text.