Add self improvement pattern with two new prompt nodes

This commit is contained in:
William Jeynes
2026-03-26 14:44:48 +00:00
parent 5e374a8bd6
commit a80d433fb6
7 changed files with 123 additions and 11 deletions
+11
View File
@@ -15,6 +15,10 @@ export async function hydratePrompt(path: string, state: any) : Promise<string>
raw = raw.replace("###LM###", state.messages.at(-1).content);
}
if (raw.indexOf("###L2M###") != -1) {
raw = raw.replace("###L2M###", state.messages.at(-2).content);
}
if (raw.indexOf("###NTITLE###") != -1) {
raw = raw.replace("###NTITLE###", state.normalizedClaim);
}
@@ -33,5 +37,12 @@ export async function hydratePrompt(path: string, state: any) : Promise<string>
raw = raw.replace("###TESEARCH###", output)
}
if (raw.indexOf("###VESEARCHES###") != -1) {
const output = state.evalTriggerEvent
.map(e => e.context)
.join("\n")
raw = raw.replace("###VESEARCHES###", output)
}
return raw;
}