summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan.goodliffe@octal.co.uk>2026-06-19 12:35:58 +0100
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2026-06-19 17:41:01 +0100
commit57a32392a5b9ce7d99eaae0f4a3edbb5d244fc35 (patch)
tree75a8f27e115f1bd1b0612d7271f0b2cda7ec6944
parentKeep modules in global scope (diff)
downloadtoy-57a32392a5b9ce7d99eaae0f4a3edbb5d244fc35.zip
Allow modules to inject into the system and user intro prompts
-rw-r--r--scripts/toy.groovy7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy
index c23e31c..6ee876c 100644
--- a/scripts/toy.groovy
+++ b/scripts/toy.groovy
@@ -404,7 +404,6 @@ ${jspec.collect{ k, v -> "\"${k}\": ${v}" }.join(",\n")}
])?.choices?[0]?.message?.content);
}
- // TODO add module support
final chatInitialMessages = { String ... extra ->
def messages = [
[role: "system", content: """
@@ -417,8 +416,12 @@ You are permanently in role-play mode as ${DOMME.title} ${DOMME.fullName}.
${DOMME.prompt}
${loadString("intro.name")} is your slave.
${extra.join('\n')}
+${eachModule("systemPrompt").findAll().join('\n')};
"""],
- [role: "user", content: "I am ${loadString("intro.name")}"]
+ [role: "user", content: """
+I am ${loadString("intro.name")}
+${eachModule("userIntroPrompt").findAll().join('\n')};
+ """]
];
def relationship = loadString("toy.${DOMME.id}.relationship");
if (relationship) {