FEAT: implement temp version of main tooling feedback loop
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import fs from "fs";
|
||||
|
||||
export function hydratePrompt(path: string, replacement: string) {
|
||||
export function hydratePrompt(path: string, state: any) {
|
||||
// TODO: expand into full context-based replacement engine
|
||||
|
||||
let raw = fs.readFileSync("prompts/" + path, "utf-8");
|
||||
|
||||
return raw.replace("###", replacement)
|
||||
}
|
||||
raw = raw.replace("###TITLE###", state.disinformationTitle);
|
||||
raw = raw.replace("###LM###", state.messages.at(-1).content);
|
||||
|
||||
return raw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user