View as Markdown

API reference: @salmonui/chat/conversation

ConversationMessageinterface

import type { ConversationMessage } from '@salmonui/chat/conversation';
interface ConversationMessage {
    readonly id: string;
    readonly author: string;
    readonly text: string;
    readonly createdAt?: Date | string | number;
    readonly status?: ConversationMessageStatus;
    readonly replyTo?: string;
    readonly replyPreview?: ConversationReplyPreview;
    readonly pinned?: boolean;
    readonly forwarded?: boolean;
    readonly mentions?: readonly string[];
    readonly attachments?: readonly ConversationAttachment[];
    readonly parts?: readonly ConversationResponsePart[];
    readonly alternatives?: readonly string[];
    readonly feedback?: 'positive' | 'negative';
}
ConversationMessage members (14)
NameSignatureDescription
idreadonly id: string;

Stable id: the list key and the store key.

authorreadonly author: string;

User id of the author.

textreadonly text: string;
createdAtoptionalreadonly createdAt?: Date | string | number;
statusoptionalreadonly status?: ConversationMessageStatus;
replyTooptionalreadonly replyTo?: string;

Id of the message this one replies to.

replyPreviewoptionalreadonly replyPreview?: ConversationReplyPreview;

Preview of the reply target when it is not in messages.

pinnedoptionalreadonly pinned?: boolean;
forwardedoptionalreadonly forwarded?: boolean;
mentionsoptionalreadonly mentions?: readonly string[];

User ids mentioned in text (rendered as mention tokens).

attachmentsoptionalreadonly attachments?: readonly ConversationAttachment[];
partsoptionalreadonly parts?: readonly ConversationResponsePart[];

Assistant responses: reasoning and tool parts, in arrival order.

alternativesoptionalreadonly alternatives?: readonly string[];

Assistant responses: earlier responses to the same prompt, oldest first; text is the latest.

feedbackoptionalreadonly feedback?: 'positive' | 'negative';

Assistant responses: the user's rating.