mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-21 08:28:12 +00:00
fix: 移除 Markdown 消息中的工具使用标签
This commit is contained in:
parent
42e4ddbd17
commit
4f2d382fd6
@ -713,6 +713,7 @@ class WebSocketDialogMsg extends AbstractModel
|
|||||||
$text = $msgData['text'] ?? '';
|
$text = $msgData['text'] ?? '';
|
||||||
if (!$text) return '';
|
if (!$text) return '';
|
||||||
if ($msgData['type'] === 'md') {
|
if ($msgData['type'] === 'md') {
|
||||||
|
$text = preg_replace('/<\/?tool-use[^>]*>/', '', $text);
|
||||||
$text = preg_replace("/:::\s*reasoning[\s\S]*?:::/", "", $text);
|
$text = preg_replace("/:::\s*reasoning[\s\S]*?:::/", "", $text);
|
||||||
if (preg_match('/:::\s*reasoning\s+/', $text)) {
|
if (preg_match('/:::\s*reasoning\s+/', $text)) {
|
||||||
return Doo::translate('思考中...');
|
return Doo::translate('思考中...');
|
||||||
|
|||||||
1
resources/assets/js/functions/web.js
vendored
1
resources/assets/js/functions/web.js
vendored
@ -269,6 +269,7 @@ import {convertLocalResourcePath} from "../components/Replace/utils";
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (type === 'md') {
|
if (type === 'md') {
|
||||||
|
text = text.replace(/<\/?tool-use[^>]*>/g, '');
|
||||||
text = text.replace(/:::\s*reasoning[\s\S]*?:::/g, "");
|
text = text.replace(/:::\s*reasoning[\s\S]*?:::/g, "");
|
||||||
if (/:::\s*reasoning\s+/.test(text)) {
|
if (/:::\s*reasoning\s+/.test(text)) {
|
||||||
return $A.L('思考中...')
|
return $A.L('思考中...')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user