I don't think this can hurt to prioritize summaries of content

This commit is contained in:
perf3ct 2025-04-17 16:30:57 +00:00
parent d1295ede90
commit 5e50a2918d
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -100,9 +100,13 @@ export class VectorSearchTool {
noteId: note.noteId, noteId: note.noteId,
title: note.title, title: note.title,
contentPreview: note.content contentPreview: note.content
? note.content.length > 200 ? (options.summarizeContent
// Don't truncate already summarized content
? note.content
// Only truncate non-summarized content
: (note.content.length > 200
? note.content.substring(0, 200) + '...' ? note.content.substring(0, 200) + '...'
: note.content : note.content))
: 'No content available', : 'No content available',
similarity: note.similarity, similarity: note.similarity,
parentId: note.parentId parentId: note.parentId
@ -144,10 +148,14 @@ export class VectorSearchTool {
return results.map(result => ({ return results.map(result => ({
noteId: result.noteId, noteId: result.noteId,
title: result.title, title: result.title,
contentPreview: result.content ? contentPreview: result.content
(result.content.length > 200 ? ? (summarize
result.content.substring(0, 200) + '...' : // Don't truncate already summarized content
result.content) ? result.content
// Only truncate non-summarized content
: (result.content.length > 200
? result.content.substring(0, 200) + '...'
: result.content))
: 'No content available', : 'No content available',
similarity: result.similarity, similarity: result.similarity,
parentId: result.parentId parentId: result.parentId