MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / addSummaryMessage

Method addSummaryMessage

packages/node-runtime/src/ai/chats.ts:938–952  ·  view source on GitHub ↗
(
    aiChatId: string,
    content: string,
    meta: { bufferBoundaryTimestamp: number; compressedMessageCount: number }
  )

Source from the content-addressed store, hash-verified

936 // ==================== Summary / 压缩专用 ====================
937
938 addSummaryMessage(
939 aiChatId: string,
940 content: string,
941 meta: { bufferBoundaryTimestamp: number; compressedMessageCount: number }
942 ): AIMessage {
943 const contentBlocks: ContentBlock[] = [
944 {
945 type: 'summary_meta',
946 bufferBoundaryTimestamp: meta.bufferBoundaryTimestamp,
947 compressedMessageCount: meta.compressedMessageCount,
948 },
949 ]
950
951 return this.addMessage(aiChatId, 'summary', content, undefined, undefined, contentBlocks)
952 }
953
954 getLatestSummary(aiChatId: string): AIMessage | null {
955 const row = [...this.getActivePathRows(aiChatId)].reverse().find((message) => message.role === 'summary')

Callers 4

checkAndCompressFunction · 0.80
compressor.test.tsFile · 0.80
chats.test.tsFile · 0.80
addSummaryMessageFunction · 0.80

Calls 1

addMessageMethod · 0.95

Tested by

no test coverage detected