chore: snapshot before performance optimization
This commit is contained in:
@@ -192,7 +192,7 @@ export class SemanticSearchService {
|
||||
|
||||
// Calculate similarities for all notes
|
||||
const similarities = notes.map(note => {
|
||||
const noteEmbedding = embeddingService.deserialize(note.embedding || '[]')
|
||||
const noteEmbedding = note.embedding ? JSON.parse(note.embedding) as number[] : []
|
||||
const similarity = embeddingService.calculateCosineSimilarity(
|
||||
queryEmbedding,
|
||||
noteEmbedding
|
||||
@@ -283,7 +283,7 @@ export class SemanticSearchService {
|
||||
// Check if embedding needs regeneration
|
||||
const shouldRegenerate = embeddingService.shouldRegenerateEmbedding(
|
||||
note.content,
|
||||
note.embedding,
|
||||
note.embedding as any,
|
||||
note.lastAiAnalysis
|
||||
)
|
||||
|
||||
@@ -298,7 +298,7 @@ export class SemanticSearchService {
|
||||
await prisma.note.update({
|
||||
where: { id: noteId },
|
||||
data: {
|
||||
embedding: embeddingService.serialize(embedding),
|
||||
embedding: embeddingService.serialize(embedding) as any,
|
||||
lastAiAnalysis: new Date()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user