Table of Contents

Constructor Message

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

Message(AuthorRole, string)

Initializes a new instance of the ChatHistory.Message class with the specified author role and content.

public Message(AuthorRole authorRole, string content)

Parameters

authorRole AuthorRole

The role of the message's author, defined by AuthorRole.

content string

The content of the message. Can be null.

Message(AuthorRole, string, Attachment)

Initializes a new instance of the ChatHistory.Message class with the specified author role, content, and a single attachment.

public Message(AuthorRole authorRole, string content, Attachment attachment)

Parameters

authorRole AuthorRole

The role of the message's author, defined by AuthorRole.

content string

The content of the message. Can be null.

attachment Attachment

The attachment associated with this message. Can be null.

Message(AuthorRole, string, IEnumerable<Attachment>)

Initializes a new instance of the ChatHistory.Message class with the specified author role, content, and a collection of attachments.

public Message(AuthorRole authorRole, string content, IEnumerable<Attachment> attachments)

Parameters

authorRole AuthorRole

The role of the message's author, defined by AuthorRole.

content string

The content of the message. Can be null.

attachments IEnumerable<Attachment>

A collection of attachments associated with this message. Can be null or empty.

Message(AuthorRole, string, TextSegmentType)

Initializes a new ChatHistory.Message with an explicit initial segment type.

public Message(AuthorRole authorRole, string content, TextSegmentType segmentType)

Parameters

authorRole AuthorRole

The role of the author (e.g., User, Assistant).

content string

The message text. Normalized to Unix line endings and trimmed; pass null to create an empty message.

segmentType TextSegmentType

The segment classification applied to the entire initial content, used for rendering and processing (e.g., UserVisible, ToolInvocation, ToolResponse). Avoid Undefined.

Remarks

Seeds the internal segment map with a single segment starting at index 0 using segmentType. Attachments, token counts, and termination state keep their defaults.