mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +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 fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { RESOURCE_DIR } from '../../resource_dir';
|
||||||
|
|
||||||
// Load system prompt from markdown file
|
// Load system prompt from markdown file
|
||||||
const loadSystemPrompt = (): string => {
|
const loadSystemPrompt = (): string => {
|
||||||
try {
|
try {
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const promptPath = path.join(RESOURCE_DIR, "llm", "prompts", "base_system_prompt.md");
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
|
|
||||||
const promptPath = path.join(__dirname, '../prompts/base_system_prompt.md');
|
|
||||||
const promptContent = fs.readFileSync(promptPath, 'utf8');
|
const promptContent = fs.readFileSync(promptPath, 'utf8');
|
||||||
// Strip the markdown title if needed
|
// Strip the markdown title if needed
|
||||||
return promptContent.replace(/^# TriliumNext Base System Prompt\n+/, '');
|
return promptContent.replace(/^# TriliumNext Base System Prompt\n+/, '');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user