mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 17:32:52 -05:00
fix: a stop sequence with a % sign no longer stops every message from sending (#32649)
This commit is contained in:
1 file changed
+7
-3
@@ -4138,9 +4138,13 @@
|
||||
|
||||
const tokens = Array.isArray(stop) ? stop : stop.split(',').map((s) => s.trim());
|
||||
|
||||
return tokens
|
||||
.filter(Boolean)
|
||||
.map((token) => decodeURIComponent(JSON.parse(`"${token.replace(/"/g, '\\"')}"`)));
|
||||
return tokens.filter(Boolean).map((token) => {
|
||||
try {
|
||||
return decodeURIComponent(JSON.parse(`"${token.replace(/"/g, '\\"')}"`));
|
||||
} catch {
|
||||
return token;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const sendMessageSocket = async (
|
||||
|
||||
Reference in new issue
Block a user