diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index b28c13fa6..cc43b746d 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -713,6 +713,7 @@ class WebSocketDialogMsg extends AbstractModel $text = $msgData['text'] ?? ''; if (!$text) return ''; if ($msgData['type'] === 'md') { + $text = preg_replace('/<\/?tool-use[^>]*>/', '', $text); $text = preg_replace("/:::\s*reasoning[\s\S]*?:::/", "", $text); if (preg_match('/:::\s*reasoning\s+/', $text)) { return Doo::translate('思考中...'); diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index 5bbf2ab62..c63b3208b 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -269,6 +269,7 @@ import {convertLocalResourcePath} from "../components/Replace/utils"; return ''; } if (type === 'md') { + text = text.replace(/<\/?tool-use[^>]*>/g, ''); text = text.replace(/:::\s*reasoning[\s\S]*?:::/g, ""); if (/:::\s*reasoning\s+/.test(text)) { return $A.L('思考中...')