Replaces older removable history with a summary message before falling back to sliding-window trimming.
const strategy = new SummarisationStrategy({ maxMessages: 10, keepLastMessages: 2, summarizer: async (messages) => `Summary of ${messages.length} messages`,}); Copy
const strategy = new SummarisationStrategy({ maxMessages: 10, keepLastMessages: 2, summarizer: async (messages) => `Summary of ${messages.length} messages`,});
Replaces older removable history with a summary message before falling back to sliding-window trimming.
Example