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
authorRoleAuthorRoleThe role of the message's author, defined by AuthorRole.
contentstringThe 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
authorRoleAuthorRoleThe role of the message's author, defined by AuthorRole.
contentstringThe content of the message. Can be
null.attachmentAttachmentThe 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
authorRoleAuthorRoleThe role of the message's author, defined by AuthorRole.
contentstringThe content of the message. Can be
null.attachmentsIEnumerable<Attachment>A collection of attachments associated with this message. Can be
nullor 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
authorRoleAuthorRolecontentstringThe message text. Normalized to Unix line endings and trimmed; pass
nullto create an empty message.segmentTypeTextSegmentTypeThe 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.