|
|
|
|
@ -9,15 +9,12 @@
|
|
|
|
|
|
|
|
|
|
import fs from 'fs';
|
|
|
|
|
import path from 'path';
|
|
|
|
|
import { fileURLToPath } from 'url';
|
|
|
|
|
import { RESOURCE_DIR } from '../../resource_dir';
|
|
|
|
|
|
|
|
|
|
// Load system prompt from markdown file
|
|
|
|
|
const loadSystemPrompt = (): string => {
|
|
|
|
|
try {
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
|
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
|
|
|
|
|
|
const promptPath = path.join(__dirname, '../prompts/base_system_prompt.md');
|
|
|
|
|
const promptPath = path.join(RESOURCE_DIR, "llm", "prompts", "base_system_prompt.md");
|
|
|
|
|
const promptContent = fs.readFileSync(promptPath, 'utf8');
|
|
|
|
|
// Strip the markdown title if needed
|
|
|
|
|
return promptContent.replace(/^# TriliumNext Base System Prompt\n+/, '');
|
|
|
|
|
|