diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-06-20 19:03:11 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-06-20 19:03:11 +0100 |
| commit | 34e296b7897edd39c3a00b0999180097aebaee6d (patch) | |
| tree | 185f02d6fe534cf69ecf5a99d3b9d052660c0b05 | |
| parent | Replace the remaining legacy image stuff (diff) | |
| download | toy-34e296b7897edd39c3a00b0999180097aebaee6d.zip | |
Replace += with .add for messages in summon
Fixes the issue where the message log changes were not propagate back
out of the function resulting in no summoning state and a repetition of
the relationship statement.
| -rw-r--r-- | scripts/toy.groovy | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/toy.groovy b/scripts/toy.groovy index b89f6b0..0866893 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -261,16 +261,16 @@ return new Object() { for (def n = 1; n <= limit; n++) { switch (n) { case 1: - messages += [role: "user", content: "I am in another room. Write only a demand for my presence."]; + messages.add([role: "user", content: "I am in another room. Write only a demand for my presence."]); break; case limit: - messages += [role: "user", content: "I am still in another room. Write only a final demand for my presence."]; + messages.add([role: "user", content: "I am still in another room. Write only a final demand for my presence."]); break; default: - messages += [role: "user", content: "I am still in another room. Write only another demand for my presence."]; + messages.add([role: "user", content: "I am still in another room. Write only another demand for my presence."]); break; } - messages += [role: "assistant", content: llmPresent(callAPI_chat(messages)).message]; + messages.add([role: "assistant", content: llmPresent(callAPI_chat(messages)).message]); //playBackgroundSound(n == limit ? "shortwhip.wav" : "bell.wav"); if (showButton("...", timeMax) < timeMax) { executeTrigger("toySummonSuccess", n); |
