MCPcopy Index your code
hub / github.com/simstudioai/sim / toRow

Function toRow

apps/sim/lib/copilot/chat/messages-store.ts:23–41  ·  view source on GitHub ↗
(
  chatId: string,
  message: PersistedMessage,
  seq: number,
  options?: { chatModel?: string | null; streamId?: string | null }
)

Source from the content-addressed store, hash-verified

21}
22
23function toRow(
24 chatId: string,
25 message: PersistedMessage,
26 seq: number,
27 options?: { chatModel?: string | null; streamId?: string | null }
28): typeof copilotMessages.$inferInsert {
29 const ts = new Date(message.timestamp)
30 return {
31 chatId,
32 messageId: message.id,
33 role: message.role,
34 content: stripToolResultOutput(message),
35 seq,
36 model: options?.chatModel ?? null,
37 streamId: options?.streamId ?? null,
38 createdAt: ts,
39 updatedAt: ts,
40 }
41}
42
43/**
44 * Append messages to the `copilot_messages` table — the sole store for chat

Callers 2

runFunction · 0.85

Calls 1

stripToolResultOutputFunction · 0.90

Tested by

no test coverage detected