Fix thoughts extraction regex for multiline content handling

This commit is contained in:
Bo26fhmC5M
2024-12-21 13:07:57 +09:00
parent bd7b58a477
commit 6d182a8ad3

View File

@@ -755,7 +755,7 @@ export async function sendChat(chatProcessIndex = -1,arg:{
}
}
let thoughts:string[] = []
formatedChat = formatedChat.replace(/<Thoughts>(.+?)<\/Thoughts>/gm, (match, p1) => {
formatedChat = formatedChat.replace(/<Thoughts>([\s\S]+?)<\/Thoughts>/g, (match, p1) => {
thoughts.push(p1)
return ''
})