diff --git a/app/Module/Extranet.php b/app/Module/Extranet.php index d732c60be..3b14dd38c 100644 --- a/app/Module/Extranet.php +++ b/app/Module/Extranet.php @@ -166,7 +166,7 @@ class Extranet $extra['CURLOPT_PROXY'] = $agency; $extra['CURLOPT_PROXYTYPE'] = str_contains($agency, 'socks') ? CURLPROXY_SOCKS5 : CURLPROXY_HTTP; } - $res = Ihttp::ihttp_request($baseUrl . '/api/tags', [], $extra, 15); + $res = Ihttp::ihttp_request(rtrim($baseUrl, '/') . '/api/tags', [], $extra, 15); if (Base::isError($res)) { return Base::retError("获取失败", $res); } diff --git a/resources/assets/js/components/VMEditor/engine/preview.vue b/resources/assets/js/components/VMEditor/engine/preview.vue index 040e8f120..c02ae71e8 100755 --- a/resources/assets/js/components/VMEditor/engine/preview.vue +++ b/resources/assets/js/components/VMEditor/engine/preview.vue @@ -1,6 +1,6 @@ @@ -70,6 +70,12 @@ export default { }); }, + computed: { + previewContent({value}) { + return MarkdownPluginUtils.clearEmptyReasoning(value); + } + }, + methods: { handleClick({target}) { if (target.nodeName === 'IMG') { diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index a9cb4968c..5da4e582c 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -89,34 +89,36 @@ -
- - {{$L('新会议')}} -
-
- - {{$L('拨打电话')}} -
-
- - {{$L('发送图片')}} -
-
- - {{$L('上传文件')}} -
-
- - {{$L('匿名消息')}} -
-
- - {{$L('发起接龙')}} -
-
- - {{$L('发起投票')}} -
+
{{$L('全屏输入')}} @@ -478,6 +480,13 @@ export default { } }, + isAiBot({dialogData}) { + if (!dialogData.bot || dialogData.type !== 'user') { + return false + } + return /^ai-(.*?)@bot\.system/.test(dialogData.email) + }, + canCall() { return this.dialogData.type === 'user' && !this.dialogData.bot && this.$isEEUiApp }, diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index a9af9fe03..6cc58e80b 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -1167,8 +1167,7 @@ export default { return dialogData.dialog_user && dialogData.dialog_user.userid == dialogData.bot && userIsAdmin }, - isAiBot() { - const {dialogData} = this; + isAiBot({dialogData}) { if (!dialogData.bot || dialogData.type !== 'user') { return false } diff --git a/resources/assets/js/store/markdown.js b/resources/assets/js/store/markdown.js index bb913b3d8..9a0ca4a54 100644 --- a/resources/assets/js/store/markdown.js +++ b/resources/assets/js/store/markdown.js @@ -68,6 +68,11 @@ const MarkdownPluginUtils = { return value; }, + // 清除空推理 + clearEmptyReasoning(text) { + return text.replace(/:::\s*reasoning\s*[\r\n]*\s*:::/g, ''); + }, + // 修改初始化插件函数(推理) initReasoningPlugin(md) { md.block.ruler.before('fence', 'reasoning', (state, startLine, endLine, silent) => { @@ -271,7 +276,9 @@ export function MarkdownConver(text) { MarkdownPluginUtils.initReasoningPlugin(MarkdownUtils.mdi); MarkdownPluginUtils.initCreateTaskPlugin(MarkdownUtils.mdi); } - return MarkdownUtils.formatMsg(MarkdownUtils.mdi.render(text)) + text = MarkdownPluginUtils.clearEmptyReasoning(text); + text = MarkdownUtils.mdi.render(text); + return MarkdownUtils.formatMsg(text) } export function MarkdownPreview(text) { @@ -280,6 +287,7 @@ export function MarkdownPreview(text) { MarkdownPluginUtils.initReasoningPlugin(MarkdownUtils.mds); MarkdownPluginUtils.initCreateTaskPlugin(MarkdownUtils.mds); } + text = MarkdownPluginUtils.clearEmptyReasoning(text); return MarkdownUtils.mds.render(text) }