ConversationHistoryManager
Defined in: packages/middleware/src/conversation-history.ts:70
Conversation history manager for accessing and manipulating history.
Methods
Section titled “Methods”addMessage()
Section titled “addMessage()”addMessage(
message):void
Defined in: packages/middleware/src/conversation-history.ts:80
Add a message to the history.
Parameters
Section titled “Parameters”message
Section titled “message”Message to add
Returns
Section titled “Returns”void
addMessages()
Section titled “addMessages()”addMessages(
messages):void
Defined in: packages/middleware/src/conversation-history.ts:86
Add multiple messages to the history.
Parameters
Section titled “Parameters”messages
Section titled “messages”Messages to add
Returns
Section titled “Returns”void
clear()
Section titled “clear()”clear():
void
Defined in: packages/middleware/src/conversation-history.ts:91
Clear the conversation history.
Returns
Section titled “Returns”void
getHistory()
Section titled “getHistory()”getHistory(): readonly
IRMessage[]
Defined in: packages/middleware/src/conversation-history.ts:74
Get the current conversation history.
Returns
Section titled “Returns”readonly IRMessage[]
getPairCount()
Section titled “getPairCount()”getPairCount():
number
Defined in: packages/middleware/src/conversation-history.ts:102
Get the number of message pairs in history (excluding system messages).
Returns
Section titled “Returns”number
setHistory()
Section titled “setHistory()”setHistory(
history):void
Defined in: packages/middleware/src/conversation-history.ts:97
Set the conversation history to a specific state.
Parameters
Section titled “Parameters”history
Section titled “history”New history state
Returns
Section titled “Returns”void
trim()
Section titled “trim()”trim():
void
Defined in: packages/middleware/src/conversation-history.ts:107
Manually trigger history trimming based on config.
Returns
Section titled “Returns”void