From 34e296b7897edd39c3a00b0999180097aebaee6d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Jun 2026 19:03:11 +0100 Subject: 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. --- scripts/toy.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') 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); -- cgit v1.3