Table of Contents

Enum TextSegmentType

Namespace
LMKit.TextGeneration.Chat
Assembly
LM-Kit.NET.dll

Identifies the kind of segment produced by the chatbot pipeline.

public enum TextSegmentType

Fields

Undefined = 0

For internal purposes only. Do not use.

InternalReasoning = 1

Internal planning/reasoning content not intended to be shown or logged.

UserVisible = 2

Natural-language content intended for end users (safe to render as-is).

ToolInvocation = 3

Directive to invoke a tool/function (may require parsing and execution).

ToolResponse = 4

Data returned by a previously invoked tool/function (raw or structured); not intended for direct rendering without validation/sanitization.

Examples

Inspecting message segments by type:

using LMKit.TextGeneration.Chat;

// After generating a response, inspect the assistant message segments: ChatHistory.Message assistantMsg = conversation.ChatHistory.Messages.Last();

foreach (var segment in assistantMsg.Segments) { if (segment.SegmentType == TextSegmentType.UserVisible) Console.WriteLine($"Response: {segment.Content}"); else if (segment.SegmentType == TextSegmentType.InternalReasoning) Console.WriteLine($"Reasoning: {segment.Content}"); }

Remarks

Used by AfterTextCompletionEventArgs to help consumers decide how to render, filter, or act on a segment.

Share