fix: 移除 Markdown 消息中的工具使用标签

This commit is contained in:
kuaifan
2026-01-13 12:57:54 +00:00
parent 42e4ddbd17
commit 4f2d382fd6
2 changed files with 2 additions and 0 deletions

View File

@@ -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('思考中...');