mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
fix(nx/docker): LLM prompts not accessible
This commit is contained in:
parent
69f854034f
commit
8f26d4cf63
@ -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+/, '');
|
||||
|
Loading…
x
Reference in New Issue
Block a user