Message


Object Hierarchy:

Object hierarchy for Message

Description:

public class Message : Object, Serializable

Message class for chat conversations with role-based behavior.

Messages have different roles that control their behavior and visibility: * "user" / "user-sent": User messages (user-sent is visible in UI) * "assistant": LLM response (not directly visible, use content-stream instead) * "content-stream" / "content-non-stream": Visible assistant content * "think-stream": Thinking output (for models that support it) * "tool": Tool execution results * "ui": UI messages displayed in chat * "ui-warning": User-friendly warning in chat (e.g. "we couldn't use that model, using default") * "ui-waiting": Transient placeholder shown while waiting for response (e.g. "waiting for a reply", "Refining..."); content is the label; animated dots; cleared when content arrives * "system": System prompts * "end-stream": Stream end marker (not displayed) * "done": Completion marker (not displayed)

Role changes automatically set flags (is_user, is_llm, is_content, etc.) for easy filtering and UI display decisions.

Example

// Create a user message
var msg = new Message("user-sent", "Hello!");

// Check message type
if (msg.is_user && msg.is_ui_visible) {
// Display in UI
}

// Create streaming content message
var content_msg = new Message("content-stream", "");
content_msg.chat_content = "Partial response...";


Namespace: OLLMchat
Package: ollmchat

Content:

Properties:

Creation methods:

Methods:

Fields:

Inherited Members:

All known members inherited from class GLib.Object
All known members inherited from interface Json.Serializable