Member Junction
    Preparing search index...

    Enhanced chat message interface extending the base ChatMessage from @memberjunction/ai. Includes additional properties for streaming, timing, error handling, and content management.

    interface ConversationMessage {
        agentRunId?: string;
        content: ChatMessageContent;
        elapsedTime?: number;
        error?: string;
        executionData?: any;
        executionTime?: number;
        id: string;
        isStreaming?: boolean;
        metadata?: any;
        payload?: any;
        payloadCollapsed?: boolean;
        rawContent?: string;
        role: ChatMessageRole;
        showJsonRaw?: boolean;
        showRaw?: boolean;
        streamingContent?: string;
        streamingStartTime?: number;
        timestamp: Date;
        toolCalls?: ChatToolCall[];
    }

    Hierarchy (View Summary)

    Index

    Properties

    agentRunId?: string

    Associated agent run ID for tracking

    Content of the message, can be any string or an array of content blocks.

    elapsedTime?: number

    Current elapsed time during streaming

    error?: string

    Error message if processing failed

    executionData?: any

    Execution data for agent runs

    executionTime?: number

    Total execution time for AI-generated messages

    id: string

    Unique identifier for this message

    isStreaming?: boolean

    Whether this message is currently being streamed

    metadata?: any

    Optional metadata for the message. The type can be specified via the generic parameter. This allows different consumers to attach their own typed metadata without modifying the core ChatMessage type.

    payload?: any

    Payload data from agent execution to display separately

    payloadCollapsed?: boolean

    Whether the payload section is collapsed

    rawContent?: string

    Original unprocessed content from the AI model

    Role of the message in the conversation.

    showJsonRaw?: boolean

    Whether JSON raw section is expanded in collapsible view

    showRaw?: boolean

    Whether to display raw content instead of processed content

    streamingContent?: string

    Accumulated content during streaming (temporary)

    streamingStartTime?: number

    Timestamp when streaming started (for elapsed time calculation)

    timestamp: Date

    Timestamp when the message was created

    toolCalls?: ChatToolCall[]

    For assistant turns that called tools: the calls the model made, so a prior tool-calling turn round-trips back to the provider on the next request. Every provider requires the assistant's own call turn to be present in history before the matching results.

    Set this from ChatCompletionMessage.toolCalls when appending the model's reply to the conversation; the tool turn that answers it follows immediately.