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

Function addMessage

apps/desktop/main/ai/chats.ts:68–86  ·  view source on GitHub ↗
(
  aiChatId: string,
  role: import('@openchatlab/node-runtime').AIMessageRole,
  content: string,
  dataKeywords?: string[],
  dataMessageCount?: number,
  contentBlocks?: import('@openchatlab/node-runtime').ContentBlock[],
  tokenUsage?: import('@openchatlab/node-runtime').TokenUsageData
)

Source from the content-addressed store, hash-verified

66}
67
68export function addMessage(
69 aiChatId: string,
70 role: import('@openchatlab/node-runtime').AIMessageRole,
71 content: string,
72 dataKeywords?: string[],
73 dataMessageCount?: number,
74 contentBlocks?: import('@openchatlab/node-runtime').ContentBlock[],
75 tokenUsage?: import('@openchatlab/node-runtime').TokenUsageData
76) {
77 return getManager().addMessage(
78 aiChatId,
79 role,
80 content,
81 dataKeywords,
82 dataMessageCount,
83 contentBlocks,
84 tokenUsage
85 )
86}
87
88export function getMessages(aiChatId: string) {
89 return getManager().getMessages(aiChatId)

Callers

nothing calls this directly

Calls 2

getManagerFunction · 0.70
addMessageMethod · 0.65

Tested by

no test coverage detected