From 6d182a8ad3fbbc5f3347fc131a784425fdc4161d Mon Sep 17 00:00:00 2001 From: Bo26fhmC5M <88071760+Bo26fhmC5M@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:07:57 +0900 Subject: [PATCH] Fix thoughts extraction regex for multiline content handling --- src/ts/process/index.svelte.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/process/index.svelte.ts b/src/ts/process/index.svelte.ts index f9c108c7..25e39f28 100644 --- a/src/ts/process/index.svelte.ts +++ b/src/ts/process/index.svelte.ts @@ -755,7 +755,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{ } } let thoughts:string[] = [] - formatedChat = formatedChat.replace(/(.+?)<\/Thoughts>/gm, (match, p1) => { + formatedChat = formatedChat.replace(/([\s\S]+?)<\/Thoughts>/g, (match, p1) => { thoughts.push(p1) return '' })