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

Method getAllMessageRows

packages/node-runtime/src/ai/chats.ts:404–414  ·  view source on GitHub ↗
(aiChatId: string)

Source from the content-addressed store, hash-verified

402 }
403
404 private getAllMessageRows(aiChatId: string): AIMessageRow[] {
405 return this.getDb()
406 .prepare(
407 `SELECT id, ai_chat_id as aiChatId, role, content, timestamp,
408 parent_id as parentId, sibling_group_id as siblingGroupId, branch_index as branchIndex,
409 data_keywords as dataKeywords, data_message_count as dataMessageCount,
410 content_blocks as contentBlocks, token_usage as tokenUsage
411 FROM ai_message WHERE ai_chat_id = ? ORDER BY timestamp ASC, id ASC`
412 )
413 .all(aiChatId) as AIMessageRow[]
414 }
415
416 private getActivePathRows(aiChatId: string, leafMessageId?: string | null): AIMessageRow[] {
417 if (leafMessageId === null) return []

Callers 1

getActivePathRowsMethod · 0.95

Calls 3

getDbMethod · 0.95
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected