ART Framework API Docs
    Preparing search index...

    Interface ConversationManager

    Interface for managing conversation history.

    interface ConversationManager {
        addMessages(
            threadId: string,
            messages: ConversationMessage[],
        ): Promise<void>;
        getMessages(
            threadId: string,
            options?: MessageOptions,
        ): Promise<ConversationMessage[]>;
    }
    Index

    Methods

    • Appends one or more ConversationMessage objects to the history of a specific thread. Typically called at the end of an execution cycle to save the user query and the final AI response.

      Parameters

      • threadId: string

        The ID of the thread to add messages to.

      • messages: ConversationMessage[]

        An array containing the ConversationMessage objects to add.

      Returns Promise<void>

      A promise that resolves when the messages have been successfully added to storage.

    • Retrieves messages from a specific thread's history, usually in reverse chronological order.

      Parameters

      • threadId: string

        The ID of the thread whose history is needed.

      • Optionaloptions: MessageOptions

        Optional parameters to control retrieval, such as limit (max number of messages) or beforeTimestamp (for pagination). See MessageOptions type.

      Returns Promise<ConversationMessage[]>

      A promise resolving to an array of ConversationMessage objects, ordered according to the implementation (typically newest first if not specified otherwise).