adds search support with exa
This commit is contained in:
@@ -22,6 +22,10 @@ enum MessageRole {
|
||||
tool
|
||||
}
|
||||
|
||||
enum SearchSource {
|
||||
exa
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
@@ -31,6 +35,7 @@ model User {
|
||||
handle String? @unique
|
||||
|
||||
chats Chat[]
|
||||
searches Search[]
|
||||
}
|
||||
|
||||
model Chat {
|
||||
@@ -92,3 +97,50 @@ model LlmCall {
|
||||
@@index([chatId, createdAt])
|
||||
@@index([provider, model, createdAt])
|
||||
}
|
||||
|
||||
model Search {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
title String?
|
||||
query String?
|
||||
|
||||
source SearchSource @default(exa)
|
||||
|
||||
requestId String?
|
||||
rawResponse Json?
|
||||
latencyMs Int?
|
||||
error String?
|
||||
|
||||
user User? @relation(fields: [userId], references: [id])
|
||||
userId String?
|
||||
|
||||
results SearchResult[]
|
||||
|
||||
@@index([updatedAt])
|
||||
@@index([userId])
|
||||
}
|
||||
|
||||
model SearchResult {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
search Search @relation(fields: [searchId], references: [id], onDelete: Cascade)
|
||||
searchId String
|
||||
|
||||
rank Int
|
||||
|
||||
title String?
|
||||
url String
|
||||
publishedDate String?
|
||||
author String?
|
||||
text String?
|
||||
highlights Json?
|
||||
highlightScores Json?
|
||||
score Float?
|
||||
favicon String?
|
||||
image String?
|
||||
|
||||
@@index([searchId, rank])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user