conversationOnlyHistory
conversationOnlyHistory(
maxHistorySize):Middleware
Defined in: packages/middleware/src/conversation-history.ts:345
Create a conversation history middleware that only tracks user/assistant pairs. System messages from requests are passed through but not tracked.
Parameters
Section titled “Parameters”maxHistorySize
Section titled “maxHistorySize”number = 10
Maximum number of message pairs
Returns
Section titled “Returns”Conversation history middleware
Example
Section titled “Example”// Track conversation but not system messagesbridge.use(conversationOnlyHistory(10));