mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
feat(llm): add utils for excluding notes from LLM
This commit is contained in:
@@ -20,6 +20,7 @@ import sql from "../sql.js";
|
||||
import sqlInit from "../sql_init.js";
|
||||
import { CONTEXT_PROMPTS } from './constants/llm_prompt_constants.js';
|
||||
import { SEARCH_CONSTANTS } from './constants/search_constants.js';
|
||||
import { isNoteExcludedFromAI } from "./utils/ai_exclusion_utils.js";
|
||||
|
||||
export class IndexService {
|
||||
private initialized = false;
|
||||
@@ -803,6 +804,12 @@ export class IndexService {
|
||||
throw new Error(`Note ${noteId} not found`);
|
||||
}
|
||||
|
||||
// Check if this note is excluded from AI features
|
||||
if (isNoteExcludedFromAI(note)) {
|
||||
log.info(`Note ${noteId} (${note.title}) excluded from AI indexing due to exclusion label`);
|
||||
return true; // Return true to indicate successful handling (exclusion is intentional)
|
||||
}
|
||||
|
||||
// Check where embedding generation should happen
|
||||
const embeddingLocation = await options.getOption('embeddingGenerationLocation') || 'client';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user