feat: support resuming ongoing streams (#974)

This commit is contained in:
Jeremy 2025-05-01 12:36:52 -07:00 committed by GitHub
parent 45978c27a2
commit a3221fbcdc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1005 additions and 47 deletions

View file

@ -150,3 +150,21 @@ export const suggestion = pgTable(
);
export type Suggestion = InferSelectModel<typeof suggestion>;
export const stream = pgTable(
'Stream',
{
id: uuid('id').notNull().defaultRandom(),
chatId: uuid('chatId').notNull(),
createdAt: timestamp('createdAt').notNull(),
},
(table) => ({
pk: primaryKey({ columns: [table.id] }),
chatRef: foreignKey({
columns: [table.chatId],
foreignColumns: [chat.id],
}),
}),
);
export type Stream = InferSelectModel<typeof stream>;