Interface IHistoryAdapter

Interface defining methods for interacting with a history adapter.

interface IHistoryAdapter {
    dispose: (clientId: string, agentName: string) => Promise<void>;
    iterate(
        clientId: string,
        agentName: string,
    ): AsyncIterableIterator<IModelMessage<object>>;
    pop: (
        clientId: string,
        agentName: string,
    ) => Promise<IModelMessage<object>>;
    push: (
        value: IModelMessage,
        clientId: string,
        agentName: string,
    ) => Promise<void>;
}

Properties

Methods

Properties

dispose: (clientId: string, agentName: string) => Promise<void>

Disposes of the history for a client and agent, optionally clearing all data.

pop: (clientId: string, agentName: string) => Promise<IModelMessage<object>>

Removes and returns the last message from the history.

push: (
    value: IModelMessage,
    clientId: string,
    agentName: string,
) => Promise<void>

Adds a new message to the history.

Methods

  • Iterates over history messages for a client and agent.

    Parameters

    • clientId: string
    • agentName: string

    Returns AsyncIterableIterator<IModelMessage<object>>