mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 21:02:49 +00:00
perf: 优化 AI 参数
This commit is contained in:
parent
a8f3b02ee7
commit
154e0039d1
@ -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);
|
||||
}
|
||||
|
||||
3
resources/assets/js/functions/web.js
vendored
3
resources/assets/js/functions/web.js
vendored
@ -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);
|
||||
}
|
||||
//
|
||||
|
||||
@ -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,
|
||||
|
||||
1
resources/assets/js/store/ai.js
vendored
1
resources/assets/js/store/ai.js
vendored
@ -211,6 +211,7 @@ const AISystemConfig = {
|
||||
prop: "base_url",
|
||||
placeholder: "Enter base URL...",
|
||||
tip: "API请求的URL路径",
|
||||
sort: 1,
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user