Skip to content

ConversationHistoryManager

Defined in: packages/middleware/src/conversation-history.ts:70

Conversation history manager for accessing and manipulating history.

addMessage(message): void

Defined in: packages/middleware/src/conversation-history.ts:80

Add a message to the history.

IRMessage

Message to add

void


addMessages(messages): void

Defined in: packages/middleware/src/conversation-history.ts:86

Add multiple messages to the history.

IRMessage[]

Messages to add

void


clear(): void

Defined in: packages/middleware/src/conversation-history.ts:91

Clear the conversation history.

void


getHistory(): readonly IRMessage[]

Defined in: packages/middleware/src/conversation-history.ts:74

Get the current conversation history.

readonly IRMessage[]


getPairCount(): number

Defined in: packages/middleware/src/conversation-history.ts:102

Get the number of message pairs in history (excluding system messages).

number


setHistory(history): void

Defined in: packages/middleware/src/conversation-history.ts:97

Set the conversation history to a specific state.

IRMessage[]

New history state

void


trim(): void

Defined in: packages/middleware/src/conversation-history.ts:107

Manually trigger history trimming based on config.

void