From fe8f3a00a2750be614f82514fb6f9c3ca3028148 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 19 Jun 2026 12:49:22 +0100 Subject: Improve the handling of the dismissal process --- scripts/toy/llmSession.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/toy/llmSession.groovy b/scripts/toy/llmSession.groovy index 68bbaf0..f140d75 100644 --- a/scripts/toy/llmSession.groovy +++ b/scripts/toy/llmSession.groovy @@ -29,7 +29,8 @@ } def messages = chatInitialMessages("You want to play with ${loadString("intro.name")}. You can dismiss ${loadString("intro.name")} when you wish by writing \"DISMISSED.\" only."); if (summon(messages)) { - while (messages.last().content != "DISMISSED.") { + while (!messages.last().content.toUpperCase().startsWith("DISMISSED") && !messages.last().content.toUpperCase().contains("YOU ARE DISMISSED")) { + llmPresent(messages.last().content); def userInput = getString(null, ""); if (userInput) { messages += [ role: "user", content: userInput ]; @@ -49,7 +50,7 @@ return; } } - messages += [role: "assistant", content: llmPresent(callAPI_chat(messages)).message]; + messages += [role: "assistant", content: callAPI_chat(messages)]; } } else { -- cgit v1.3