perf: 优化 AI 参数

This commit is contained in:
kuaifan 2025-02-22 11:13:16 +08:00
parent a8f3b02ee7
commit 154e0039d1
4 changed files with 20 additions and 0 deletions

View File

@ -665,6 +665,9 @@ class WebSocketDialogMsg extends AbstractModel
if (!$text) return '';
if ($msgData['type'] === 'md') {
$text = preg_replace("/:::\s*reasoning[\s\S]*?:::/", "", $text);
if (preg_match('/:::\s*reasoning\s+/', $text)) {
return Doo::translate('思考中...');
}
$text = Base::markdown2html($text);
$text = self::previewConvertTaskList($text);
}

View File

@ -247,6 +247,9 @@ import {convertLocalResourcePath} from "../components/Replace/utils";
}
if (type === 'md') {
text = text.replace(/:::\s*reasoning[\s\S]*?:::/g, "");
if (/:::\s*reasoning\s+/.test(text)) {
return $A.L('思考中...')
}
text = MarkdownPreview(text);
}
//

View File

@ -133,6 +133,18 @@ export default {
}
});
// sort
let sort = 9999999;
prefixedFields.forEach(field => {
if (typeof field.sort === 'undefined') {
field.sort = ++sort;
}
});
// sort
prefixedFields.sort((a, b) => a.sort - b.sort);
//
return prefixedFields;
},
},
@ -189,6 +201,7 @@ export default {
return;
}
data.base_url = this.formData[`${this.type}_base_url`];
data.key = this.formData[`${this.type}_key`];
}
this.$store.dispatch("call", {
url: 'system/setting/aibot_defmodels?type=' + this.type,

View File

@ -211,6 +211,7 @@ const AISystemConfig = {
prop: "base_url",
placeholder: "Enter base URL...",
tip: "API请求的URL路径",
sort: 1,
}
]
},