Skip to main content

Interface: HistoryManager

Defined in: chat/dist/types/history/history-manager.d.ts:35

HistoryManager interface for pluggable history backends

Methods

addMessage()

addMessage(message): Promise<void>

Defined in: chat/dist/types/history/history-manager.d.ts:40

Add a message to the history Timestamp will be added automatically if not provided

Parameters

message

ChatMessage

Returns

Promise<void>


clear()

clear(): Promise<void>

Defined in: chat/dist/types/history/history-manager.d.ts:49

Clear all messages from history

Returns

Promise<void>


getMessages()

getMessages(limit?): Promise<ChatMessage[]>

Defined in: chat/dist/types/history/history-manager.d.ts:45

Get messages from history

Parameters

limit?

number

Optional limit on number of messages to return (most recent)

Returns

Promise<ChatMessage[]>


getSummary()

getSummary(): Promise<string>

Defined in: chat/dist/types/history/history-manager.d.ts:53

Get a text summary of the conversation history

Returns

Promise<string>


serialize()

serialize(): Promise<string>

Defined in: chat/dist/types/history/history-manager.d.ts:57

Serialize history to JSON string

Returns

Promise<string>