feat: implemented supporters
This commit is contained in:
16
src/openrouter/promptLoader.ts
Normal file
16
src/openrouter/promptLoader.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { readFile } from "fs/promises";
|
||||
import path from "path";
|
||||
|
||||
const prompts = ["PERSONA_INIT", "PERSONA_BASE_SYSTEM_PROMPT"] as const;
|
||||
export type PromptKey = (typeof prompts)[number];
|
||||
|
||||
function fileName(promptKey: PromptKey): string {
|
||||
return promptKey.toLowerCase() + ".md";
|
||||
}
|
||||
|
||||
const PROMPTS_DIR = path.resolve(import.meta.dir, "../../prompts");
|
||||
|
||||
export async function loadPrompt(promptKey: PromptKey): Promise<string> {
|
||||
const filePath = path.join(PROMPTS_DIR, fileName(promptKey));
|
||||
return readFile(filePath, "utf-8");
|
||||
}
|
||||
Reference in New Issue
Block a user