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

Method parseMessageRow

packages/node-runtime/src/ai/chats.ts:355–368  ·  view source on GitHub ↗
(row: AIMessageRow)

Source from the content-addressed store, hash-verified

353 }
354
355 private parseMessageRow(row: AIMessageRow): AIMessage {
356 return {
357 id: row.id,
358 aiChatId: row.aiChatId,
359 role: row.role as AIMessageRole,
360 content: row.content,
361 timestamp: row.timestamp,
362 parentId: row.parentId ?? null,
363 dataKeywords: row.dataKeywords ? JSON.parse(row.dataKeywords) : undefined,
364 dataMessageCount: row.dataMessageCount ?? undefined,
365 contentBlocks: row.contentBlocks ? JSON.parse(row.contentBlocks) : undefined,
366 tokenUsage: row.tokenUsage ? JSON.parse(row.tokenUsage) : undefined,
367 }
368 }
369
370 private getMessageRow(messageId: string): AIMessageRow | null {
371 const db = this.getDb()

Callers 3

getMessagesMethod · 0.95
getHistoryForAgentMethod · 0.95
getLatestSummaryMethod · 0.95

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected