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

    Interface UseAgentConversationsReturn

    Return type for useAgentConversations hook

    interface UseAgentConversationsReturn {
        activeConversation: AgentConversation | null;
        activeConversationId: string | null;
        addMessage: (
            message: Omit<AgentAssistantMessage, "id" | "timestamp"> & {
                timestamp?: Date;
            },
        ) => string;
        clearActiveConversation: () => void;
        clearAllConversations: () => void;
        clearPendingAction: () => void;
        conversations: AgentConversation[];
        createConversation: () => string;
        deleteConversation: (id: string) => void;
        deleteMessage: (messageId: string) => void;
        ensureActiveConversation: () => string;
        renameConversation: (id: string, title: string) => void;
        switchConversation: (id: string) => void;
        updateMessageFormState: (
            messageId: string,
            formState: Partial<
                | {
                    status: "cancelled"
                    | "pending"
                    | "submitting"
                    | "submitted";
                    submittedAt?: string;
                    values?: Record<string, unknown>;
                }
                | undefined,
            >,
        ) => void;
        updateMessageResult: (
            messageId: string,
            newResult: Record<string, unknown>,
        ) => void;
        updatePendingAction: (
            pendingAction: Record<string, unknown> | null,
        ) => void;
    }
    Index

    Properties

    activeConversation: AgentConversation | null

    Currently active conversation

    activeConversationId: string | null

    Currently active conversation ID

    addMessage: (
        message: Omit<AgentAssistantMessage, "id" | "timestamp"> & {
            timestamp?: Date;
        },
    ) => string

    Add a message to the active conversation

    clearActiveConversation: () => void

    Clear the active conversation's messages

    clearAllConversations: () => void

    Clear all conversations

    clearPendingAction: () => void

    Clear the pending action

    conversations: AgentConversation[]

    All conversations

    createConversation: () => string

    Create a new conversation

    deleteConversation: (id: string) => void

    Delete a conversation

    deleteMessage: (messageId: string) => void

    Delete a message from the active conversation

    ensureActiveConversation: () => string

    Ensure there's an active conversation (creates one if needed)

    renameConversation: (id: string, title: string) => void

    Rename a conversation

    switchConversation: (id: string) => void

    Switch to a conversation

    updateMessageFormState: (
        messageId: string,
        formState: Partial<
            | {
                status: "cancelled"
                | "pending"
                | "submitting"
                | "submitted";
                submittedAt?: string;
                values?: Record<string, unknown>;
            }
            | undefined,
        >,
    ) => void

    Update a message's form state

    updateMessageResult: (
        messageId: string,
        newResult: Record<string, unknown>,
    ) => void

    Update a message's result

    updatePendingAction: (pendingAction: Record<string, unknown> | null) => void

    Update the pending action on the active conversation