MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / itemToRow

Function itemToRow

apps/api/src/agents/persistence.ts:35–46  ·  view source on GitHub ↗
(conversationId: string, item: ConversationItem)

Source from the content-addressed store, hash-verified

33}
34
35function itemToRow(conversationId: string, item: ConversationItem) {
36 return {
37 conversationId,
38 role: roleOf(item),
39 // Prisma's `IPrismaUIMessageParts` narrows to `unknown[]`, but our
40 // JSON column stores a single `ConversationItem` object. The
41 // runtime is fine — Prisma accepts any JSON-serializable value —
42 // so we cast past the generator.
43 // biome-ignore lint/suspicious/noExplicitAny: see comment above
44 parts: item as any,
45 };
46}
47
48export const prismaConversationStore: ConversationStore = {
49 async load({ conversationId }) {

Callers 1

saveFunction · 0.85

Calls 1

roleOfFunction · 0.85

Tested by

no test coverage detected