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

Method getMessageRow

packages/node-runtime/src/ai/chats.ts:370–382  ·  view source on GitHub ↗
(messageId: string)

Source from the content-addressed store, hash-verified

368 }
369
370 private getMessageRow(messageId: string): AIMessageRow | null {
371 const db = this.getDb()
372 const row = db
373 .prepare(
374 `SELECT id, ai_chat_id as aiChatId, role, content, timestamp,
375 parent_id as parentId, sibling_group_id as siblingGroupId, branch_index as branchIndex,
376 data_keywords as dataKeywords, data_message_count as dataMessageCount,
377 content_blocks as contentBlocks, token_usage as tokenUsage
378 FROM ai_message WHERE id = ?`
379 )
380 .get(messageId) as AIMessageRow | undefined
381 return row ?? null
382 }
383
384 private getActiveMessageId(aiChatId: string): string | null {
385 const db = this.getDb()

Callers 2

deleteMessagesFromMethod · 0.95

Calls 3

getDbMethod · 0.95
getMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected