Merge pull request #830 from lc-soft/fix/tool-input-json-format

Clean 3-line fix for object-type tool input in formatToolJson.
This commit is contained in:
Jaber Jaber
2026-03-27 04:52:46 +03:00
committed by GitHub
@@ -1145,6 +1145,9 @@ function chatPage() {
formatToolJson: function(text) {
if (!text) return '';
if (typeof text === 'object') {
return JSON.stringify(text, null, 2);
}
try { return JSON.stringify(JSON.parse(text), null, 2); }
catch(e) { return text; }
},