feat(*): add RAG support
This commit is contained in:
@@ -10,7 +10,13 @@ export default defineSchema({
|
||||
followUpPrompt: v.optional(v.string()),
|
||||
model: v.string(),
|
||||
followUpModel: v.optional(v.string()),
|
||||
activeChatId: v.optional(v.id('chats'))
|
||||
activeChatId: v.optional(v.id('chats')),
|
||||
ragCollectionMode: v.optional(
|
||||
v.object({
|
||||
ragDatabaseId: v.id('ragDatabases'),
|
||||
activeSince: v.number()
|
||||
})
|
||||
)
|
||||
}).index('by_telegram_id', ['telegramId']),
|
||||
|
||||
chats: defineTable({
|
||||
@@ -98,5 +104,23 @@ export default defineSchema({
|
||||
base64: v.string(),
|
||||
mediaType: v.string(),
|
||||
createdAt: v.number()
|
||||
}).index('by_chat_id_and_device_id', ['chatId', 'deviceId'])
|
||||
}).index('by_chat_id_and_device_id', ['chatId', 'deviceId']),
|
||||
|
||||
ragDatabases: defineTable({
|
||||
userId: v.id('users'),
|
||||
name: v.string(),
|
||||
createdAt: v.number()
|
||||
})
|
||||
.index('by_user_id', ['userId'])
|
||||
.index('by_user_id_and_name', ['userId', 'name']),
|
||||
|
||||
ragConnections: defineTable({
|
||||
userId: v.id('users'),
|
||||
ragDatabaseId: v.id('ragDatabases'),
|
||||
isGlobal: v.boolean(),
|
||||
createdAt: v.number()
|
||||
})
|
||||
.index('by_user_id', ['userId'])
|
||||
.index('by_user_id_and_rag_database_id', ['userId', 'ragDatabaseId'])
|
||||
.index('by_rag_database_id', ['ragDatabaseId'])
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user