This commit was merged in pull request #78.
This commit is contained in:
@@ -13,3 +13,4 @@ export * from "./nostr-trust-vouches";
|
||||
export * from "./relay-accounts";
|
||||
export * from "./relay-event-queue";
|
||||
export * from "./job-debates";
|
||||
export * from "./session-messages";
|
||||
|
||||
18
lib/db/src/schema/session-messages.ts
Normal file
18
lib/db/src/schema/session-messages.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { pgTable, text, timestamp, integer, serial } from "drizzle-orm/pg-core";
|
||||
import { sessions } from "./sessions";
|
||||
|
||||
// ── session_messages ────────────────────────────────────────────────────────
|
||||
// Stores conversation history for context injection into the work model.
|
||||
|
||||
export const sessionMessages = pgTable("session_messages", {
|
||||
id: serial("id").primaryKey(),
|
||||
sessionId: text("session_id")
|
||||
.notNull()
|
||||
.references(() => sessions.id),
|
||||
role: text("role").$type<"user" | "assistant">().notNull(),
|
||||
content: text("content").notNull(),
|
||||
tokenCount: integer("token_count"),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export type SessionMessage = typeof sessionMessages.$inferSelect;
|
||||
Reference in New Issue
Block a user