Hiyve Components - v1.0.0
    Preparing search index...

    Interface AiChatMessage

    AI assistant chat message stored in context.

    A simple generic shape for AI chat messages that can be stored in ChatContext. This allows the conversation state to persist across component unmounts (e.g., sidebar tab switches).

    Using AI chat with external state:

    function AIPanel() {
    const { messages, setMessages } = useAiChat();

    return (
    <AIAssistant
    messages={messages}
    onMessagesChange={setMessages}
    />
    );
    }

    useAiChat for the hook to access AI chat state

    interface AiChatMessage {
        content: string;
        error?: string;
        id: string;
        isStreaming?: boolean;
        role: "user" | "assistant" | "system";
        status?: string;
        timestamp: Date;
    }
    Index

    Properties

    content: string

    Message content (supports markdown)

    error?: string

    Error message if status is error

    id: string

    Unique message identifier

    isStreaming?: boolean

    Whether the message is streaming

    role: "user" | "assistant" | "system"

    Message role

    status?: string

    Message status

    timestamp: Date

    When the message was created