feat(i18n): replace hardcoded Chinese strings with i18n calls across frontend
Replace all user-visible hardcoded Chinese strings in Vue/TS source files
with proper i18n function calls and add corresponding translation keys
to all 4 locale files (zh-CN, en-US, ko-KR, ru-RU).
Changes:
- Replace 80+ hardcoded Chinese strings across 30+ source files
- Add ~450 new translation keys per locale file
- Cover components, views, utils, hooks, and API modules
- Remove Chinese fallback patterns (|| '中文') from existing t() calls
- Add mermaid toolbar and ollama date format translations
Intentionally preserved (backend API values / backward compatibility):
- FAQ CSV column headers and parsing constants
- RelevanceLevel type and Record key mappings
- Graph database engine status comparison ('未启用')
- Language name labels ('简体中文')
This commit is contained in:
@@ -36,14 +36,14 @@
|
||||
<div v-show="currentSection === 'basic'" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.basicInfo') }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.basicInfoDesc') || '配置智能体的基本信息' }}</p>
|
||||
<p class="section-description">{{ $t('agent.editor.basicInfoDesc') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
<!-- 内置智能体提示 -->
|
||||
<div v-if="isBuiltinAgent" class="builtin-agent-notice">
|
||||
<t-icon name="info-circle" />
|
||||
<span>这是内置智能体,名称和描述不可修改,但可以调整配置参数</span>
|
||||
<span>{{ $t('agentEditor.builtinHint') }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 运行模式(首先选择) -->
|
||||
@@ -68,7 +68,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.name') }} <span v-if="!isBuiltinAgent" class="required">*</span></label>
|
||||
<p class="desc">为智能体设置一个易于识别的名称</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.name') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="name-input-wrapper">
|
||||
@@ -92,7 +92,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.description') }}</label>
|
||||
<p class="desc">简要描述智能体的用途和特点</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.description') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-textarea
|
||||
@@ -108,13 +108,13 @@
|
||||
<div class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.systemPrompt') }} <span v-if="!isBuiltinAgent" class="required">*</span></label>
|
||||
<p class="desc">自定义系统提示词,定义智能体的行为和角色{{ isBuiltinAgent ? '(留空则使用系统默认)' : '' }}</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.systemPrompt') }}{{ isBuiltinAgent ? $t('agentEditor.desc.leaveEmptyDefault') : '' }}</p>
|
||||
<div class="placeholder-tags">
|
||||
<span class="placeholder-label">可用变量:</span>
|
||||
<span class="placeholder-label">{{ $t('agentEditor.placeholders.available') }}</span>
|
||||
<t-tooltip
|
||||
v-for="placeholder in availablePlaceholders"
|
||||
:key="placeholder.name"
|
||||
:content="placeholder.description + '(点击插入)'"
|
||||
:content="placeholder.description + $t('agentEditor.placeholders.clickToInsert')"
|
||||
placement="top"
|
||||
>
|
||||
<span
|
||||
@@ -123,7 +123,7 @@
|
||||
v-text="'{{' + placeholder.name + '}}'"
|
||||
></span>
|
||||
</t-tooltip>
|
||||
<span class="placeholder-hint" v-text="'(点击插入,或输入 {{ 唤起列表)'"></span>
|
||||
<span class="placeholder-hint">{{ $t('agentEditor.placeholders.hint') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full" style="position: relative;">
|
||||
@@ -191,14 +191,14 @@
|
||||
<!-- 上下文模板(仅普通模式) -->
|
||||
<div v-if="!isAgentMode" class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.contextTemplate') || '上下文模板' }} <span v-if="!isBuiltinAgent" class="required">*</span></label>
|
||||
<p class="desc">定义如何将检索到的内容格式化后传递给模型{{ isBuiltinAgent ? '(留空则使用系统默认)' : '' }}</p>
|
||||
<label>{{ $t('agent.editor.contextTemplate') }} <span v-if="!isBuiltinAgent" class="required">*</span></label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.contextTemplate') }}{{ isBuiltinAgent ? $t('agentEditor.desc.leaveEmptyDefault') : '' }}</p>
|
||||
<div class="placeholder-tags">
|
||||
<span class="placeholder-label">可用变量:</span>
|
||||
<span class="placeholder-label">{{ $t('agentEditor.placeholders.available') }}</span>
|
||||
<t-tooltip
|
||||
v-for="placeholder in contextTemplatePlaceholders"
|
||||
:key="placeholder.name"
|
||||
:content="placeholder.description + '(点击插入)'"
|
||||
:content="placeholder.description + $t('agentEditor.placeholders.clickToInsert')"
|
||||
placement="top"
|
||||
>
|
||||
<span
|
||||
@@ -207,7 +207,7 @@
|
||||
v-text="'{{' + placeholder.name + '}}'"
|
||||
></span>
|
||||
</t-tooltip>
|
||||
<span class="placeholder-hint" v-text="'(点击插入,或输入 {{ 唤起列表)'"></span>
|
||||
<span class="placeholder-hint">{{ $t('agentEditor.placeholders.hint') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full" style="position: relative;">
|
||||
@@ -261,7 +261,7 @@
|
||||
<div v-show="currentSection === 'model'" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.modelConfig') }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.modelConfigDesc') || '配置智能体的模型参数' }}</p>
|
||||
<p class="section-description">{{ $t('agent.editor.modelConfigDesc') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
@@ -269,7 +269,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.model') }} <span class="required">*</span></label>
|
||||
<p class="desc">选择智能体使用的大语言模型</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.model') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<ModelSelector
|
||||
@@ -287,7 +287,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.temperature') }}</label>
|
||||
<p class="desc">控制输出的随机性,0 最确定,1 最随机</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.temperature') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -300,8 +300,8 @@
|
||||
<!-- 最大生成Token数(仅普通模式) -->
|
||||
<div v-if="!isAgentMode" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.maxCompletionTokens') || '最大生成Token数' }}</label>
|
||||
<p class="desc">模型生成回复的最大Token数量</p>
|
||||
<label>{{ $t('agent.editor.maxCompletionTokens') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.maxTokens') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-input-number v-model="formData.config.max_completion_tokens" :min="100" :max="100000" :step="100" theme="column" />
|
||||
@@ -311,8 +311,8 @@
|
||||
<!-- 思考模式 -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.thinking') || '思考模式' }}</label>
|
||||
<p class="desc">启用模型的扩展思考能力(需要模型支持)</p>
|
||||
<label>{{ $t('agent.editor.thinking') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.thinking') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="thinkingEnabled" />
|
||||
@@ -324,8 +324,8 @@
|
||||
<!-- 多轮对话(仅普通模式显示,Agent模式内部自动控制) -->
|
||||
<div v-show="currentSection === 'conversation' && !isAgentMode" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.conversationSettings') || '多轮对话' }}</h2>
|
||||
<p class="section-description">配置多轮对话和问题改写相关参数</p>
|
||||
<h2>{{ $t('agent.editor.conversationSettings') }}</h2>
|
||||
<p class="section-description">{{ $t('agentEditor.desc.conversationSection') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
@@ -333,7 +333,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.multiTurn') }}</label>
|
||||
<p class="desc">开启后将保留历史对话上下文</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.multiTurn') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="formData.config.multi_turn_enabled" />
|
||||
@@ -344,7 +344,7 @@
|
||||
<div v-if="formData.config.multi_turn_enabled" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.historyTurns') }}</label>
|
||||
<p class="desc">保留最近几轮对话作为上下文</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.historyRounds') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-input-number v-model="formData.config.history_turns" :min="1" :max="20" theme="column" />
|
||||
@@ -354,8 +354,8 @@
|
||||
<!-- 问题改写(仅多轮对话开启且普通模式时显示) -->
|
||||
<div v-if="formData.config.multi_turn_enabled && !isAgentMode" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.enableRewrite') || '问题改写' }}</label>
|
||||
<p class="desc">多轮对话时自动改写用户问题,消解指代和补全省略</p>
|
||||
<label>{{ $t('agent.editor.enableRewrite') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.rewrite') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="formData.config.enable_rewrite" />
|
||||
@@ -365,14 +365,14 @@
|
||||
<!-- 改写系统提示词 -->
|
||||
<div v-if="formData.config.multi_turn_enabled && !isAgentMode && formData.config.enable_rewrite" class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.rewritePromptSystem') || '改写系统提示词' }}</label>
|
||||
<p class="desc">用于问题改写的系统提示词(留空使用默认)</p>
|
||||
<label>{{ $t('agent.editor.rewritePromptSystem') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.rewriteSystemPrompt') }}</p>
|
||||
<div class="placeholder-tags" v-if="rewriteSystemPlaceholders.length > 0">
|
||||
<span class="placeholder-label">可用变量:</span>
|
||||
<span class="placeholder-label">{{ $t('agentEditor.placeholders.available') }}</span>
|
||||
<t-tooltip
|
||||
v-for="placeholder in rewriteSystemPlaceholders"
|
||||
:key="placeholder.name"
|
||||
:content="placeholder.description + '(点击插入)'"
|
||||
:content="placeholder.description + $t('agentEditor.placeholders.clickToInsert')"
|
||||
placement="top"
|
||||
>
|
||||
<span
|
||||
@@ -381,7 +381,7 @@
|
||||
v-text="'{{' + placeholder.name + '}}'"
|
||||
></span>
|
||||
</t-tooltip>
|
||||
<span class="placeholder-hint" v-text="'(点击插入,或输入 {{ 唤起列表)'"></span>
|
||||
<span class="placeholder-hint">{{ $t('agentEditor.placeholders.hint') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full" style="position: relative;">
|
||||
@@ -389,7 +389,7 @@
|
||||
<t-textarea
|
||||
ref="rewriteSystemTextareaRef"
|
||||
v-model="formData.config.rewrite_prompt_system"
|
||||
:placeholder="defaultRewritePromptSystem || $t('agent.editor.rewritePromptSystemPlaceholder') || '留空使用系统默认提示词'"
|
||||
:placeholder="defaultRewritePromptSystem || $t('agent.editor.rewritePromptSystemPlaceholder')"
|
||||
:autosize="{ minRows: 4, maxRows: 10 }"
|
||||
@input="handleRewriteSystemInput"
|
||||
/>
|
||||
@@ -428,14 +428,14 @@
|
||||
<!-- 改写用户提示词 -->
|
||||
<div v-if="formData.config.multi_turn_enabled && !isAgentMode && formData.config.enable_rewrite" class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.rewritePromptUser') || '改写用户提示词' }}</label>
|
||||
<p class="desc">用于问题改写的用户提示词模板(留空使用默认)</p>
|
||||
<label>{{ $t('agent.editor.rewritePromptUser') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.rewriteUserPrompt') }}</p>
|
||||
<div class="placeholder-tags" v-if="rewritePlaceholders.length > 0">
|
||||
<span class="placeholder-label">可用变量:</span>
|
||||
<span class="placeholder-label">{{ $t('agentEditor.placeholders.available') }}</span>
|
||||
<t-tooltip
|
||||
v-for="placeholder in rewritePlaceholders"
|
||||
:key="placeholder.name"
|
||||
:content="placeholder.description + '(点击插入)'"
|
||||
:content="placeholder.description + $t('agentEditor.placeholders.clickToInsert')"
|
||||
placement="top"
|
||||
>
|
||||
<span
|
||||
@@ -444,7 +444,7 @@
|
||||
v-text="'{{' + placeholder.name + '}}'"
|
||||
></span>
|
||||
</t-tooltip>
|
||||
<span class="placeholder-hint" v-text="'(点击插入,或输入 {{ 唤起列表)'"></span>
|
||||
<span class="placeholder-hint">{{ $t('agentEditor.placeholders.hint') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full" style="position: relative;">
|
||||
@@ -452,7 +452,7 @@
|
||||
<t-textarea
|
||||
ref="rewriteUserTextareaRef"
|
||||
v-model="formData.config.rewrite_prompt_user"
|
||||
:placeholder="defaultRewritePromptUser || $t('agent.editor.rewritePromptUserPlaceholder') || '留空使用系统默认提示词'"
|
||||
:placeholder="defaultRewritePromptUser || $t('agent.editor.rewritePromptUserPlaceholder')"
|
||||
:autosize="{ minRows: 4, maxRows: 10 }"
|
||||
@input="handleRewriteUserInput"
|
||||
/>
|
||||
@@ -493,8 +493,8 @@
|
||||
<!-- 工具配置(仅 Agent 模式) -->
|
||||
<div v-show="currentSection === 'tools' && isAgentMode" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.toolsConfig') || '工具配置' }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.toolsConfigDesc') || '配置 Agent 可以使用的工具' }}</p>
|
||||
<h2>{{ $t('agent.editor.toolsConfig') }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.toolsConfigDesc') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
@@ -502,7 +502,7 @@
|
||||
<div class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.allowedTools') }}</label>
|
||||
<p class="desc">选择 Agent 可以使用的工具</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.selectTools') }}</p>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full">
|
||||
<t-checkbox-group v-model="formData.config.allowed_tools" class="tools-checkbox-group">
|
||||
@@ -516,7 +516,7 @@
|
||||
<div class="tool-item-content">
|
||||
<span class="tool-name">{{ tool.label }}</span>
|
||||
<span v-if="tool.description" class="tool-desc">{{ tool.description }}</span>
|
||||
<span v-if="tool.disabled" class="tool-disabled-hint">(需要配置知识库)</span>
|
||||
<span v-if="tool.disabled" class="tool-disabled-hint">{{ $t('agentEditor.tools.requiresKb') }}</span>
|
||||
</div>
|
||||
</t-checkbox>
|
||||
</t-checkbox-group>
|
||||
@@ -527,7 +527,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.maxIterations') }}</label>
|
||||
<p class="desc">Agent 执行任务时的最大推理步骤数</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.maxIterations') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-input-number v-model="formData.config.max_iterations" :min="1" :max="50" theme="column" />
|
||||
@@ -537,14 +537,14 @@
|
||||
<!-- MCP 服务选择 -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>MCP 服务</label>
|
||||
<p class="desc">选择 Agent 可以调用的 MCP 服务</p>
|
||||
<label>{{ $t('agentEditor.mcp.label') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.mcp.desc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-radio-group v-model="mcpSelectionMode">
|
||||
<t-radio-button value="all">全部</t-radio-button>
|
||||
<t-radio-button value="selected">指定</t-radio-button>
|
||||
<t-radio-button value="none">禁用</t-radio-button>
|
||||
<t-radio-button value="all">{{ $t('agentEditor.selection.all') }}</t-radio-button>
|
||||
<t-radio-button value="selected">{{ $t('agentEditor.selection.selected') }}</t-radio-button>
|
||||
<t-radio-button value="none">{{ $t('agentEditor.selection.disabled') }}</t-radio-button>
|
||||
</t-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
@@ -552,14 +552,14 @@
|
||||
<!-- 选择指定 MCP 服务 -->
|
||||
<div v-if="mcpSelectionMode === 'selected' && mcpOptions.length > 0" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>选择 MCP 服务</label>
|
||||
<p class="desc">选择要启用的 MCP 服务</p>
|
||||
<label>{{ $t('agentEditor.mcp.selectLabel') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.mcp.selectDesc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-select
|
||||
v-model="formData.config.mcp_services"
|
||||
multiple
|
||||
placeholder="选择 MCP 服务"
|
||||
<t-select
|
||||
v-model="formData.config.mcp_services"
|
||||
multiple
|
||||
:placeholder="$t('agentEditor.mcp.selectPlaceholder')"
|
||||
filterable
|
||||
>
|
||||
<t-option
|
||||
@@ -641,8 +641,8 @@
|
||||
<!-- 知识库配置 -->
|
||||
<div v-show="currentSection === 'knowledge'" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.knowledgeConfig') || '知识库' }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.knowledgeConfigDesc') || '配置智能体可访问的知识库' }}</p>
|
||||
<h2>{{ $t('agent.editor.knowledgeConfig') }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.knowledgeConfigDesc') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
@@ -650,13 +650,13 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.knowledgeBases') }}</label>
|
||||
<p class="desc">选择智能体可访问的知识库范围</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.kbScope') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-radio-group v-model="kbSelectionMode">
|
||||
<t-radio-button value="all">{{ $t('agent.editor.allKnowledgeBases') || '全部' }}</t-radio-button>
|
||||
<t-radio-button value="selected">{{ $t('agent.editor.selectedKnowledgeBases') || '指定' }}</t-radio-button>
|
||||
<t-radio-button value="none">{{ $t('agent.editor.noKnowledgeBase') || '禁用' }}</t-radio-button>
|
||||
<t-radio-button value="all">{{ $t('agent.editor.allKnowledgeBases') }}</t-radio-button>
|
||||
<t-radio-button value="selected">{{ $t('agent.editor.selectedKnowledgeBases') }}</t-radio-button>
|
||||
<t-radio-button value="none">{{ $t('agent.editor.noKnowledgeBase') }}</t-radio-button>
|
||||
</t-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
@@ -715,14 +715,14 @@
|
||||
<!-- 支持的文件类型(限制用户可选择的文件类型) -->
|
||||
<div v-if="hasKnowledgeBase" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>支持的文件类型</label>
|
||||
<p class="desc">限制可选择的文件类型,留空表示支持所有类型</p>
|
||||
<label>{{ $t('agentEditor.fileTypes.label') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.fileTypes.desc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-select
|
||||
v-model="formData.config.supported_file_types"
|
||||
multiple
|
||||
placeholder="全部类型"
|
||||
:placeholder="$t('agentEditor.fileTypes.allTypes')"
|
||||
:min-collapsed-num="3"
|
||||
clearable
|
||||
>
|
||||
@@ -739,8 +739,8 @@
|
||||
<!-- 仅在提及时检索知识库(当配置了知识库时显示) -->
|
||||
<div v-if="hasKnowledgeBase" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.retrieveKBOnlyWhenMentioned') || '仅在 @ 提及时检索' }}</label>
|
||||
<p class="desc">{{ $t('agent.editor.retrieveKBOnlyWhenMentionedDesc') || '开启后,只有用户明确 @ 提及知识库或文档时才会进行检索' }}</p>
|
||||
<label>{{ $t('agent.editor.retrieveKBOnlyWhenMentioned') }}</label>
|
||||
<p class="desc">{{ $t('agent.editor.retrieveKBOnlyWhenMentionedDesc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="formData.config.retrieve_kb_only_when_mentioned" />
|
||||
@@ -769,8 +769,8 @@
|
||||
<div v-if="hasFaqKnowledgeBase" class="faq-strategy-section">
|
||||
<div class="faq-strategy-header">
|
||||
<t-icon name="chat-bubble-help" class="faq-icon" />
|
||||
<span>FAQ 优先策略</span>
|
||||
<t-tooltip content="当知识库中包含 FAQ(问答对)时,可以启用此策略让 FAQ 答案优先于普通文档">
|
||||
<span>{{ $t('agentEditor.faq.title') }}</span>
|
||||
<t-tooltip :content="$t('agentEditor.faq.tooltip')">
|
||||
<t-icon name="help-circle" class="help-icon" />
|
||||
</t-tooltip>
|
||||
</div>
|
||||
@@ -778,8 +778,8 @@
|
||||
<!-- FAQ 优先开关 -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>启用 FAQ 优先</label>
|
||||
<p class="desc">FAQ 答案将优先于普通文档被引用,提高回答准确性</p>
|
||||
<label>{{ $t('agentEditor.faq.enableLabel') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.faq.enableDesc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="formData.config.faq_priority_enabled" />
|
||||
@@ -789,8 +789,8 @@
|
||||
<!-- FAQ 直接回答阈值 -->
|
||||
<div v-if="formData.config.faq_priority_enabled" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>直接回答阈值</label>
|
||||
<p class="desc">当问题与 FAQ 相似度超过此值时,直接使用 FAQ 答案</p>
|
||||
<label>{{ $t('agentEditor.faq.thresholdLabel') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.faq.thresholdDesc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -803,8 +803,8 @@
|
||||
<!-- FAQ 分数加权 -->
|
||||
<div v-if="formData.config.faq_priority_enabled" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>FAQ 分数加权</label>
|
||||
<p class="desc">FAQ 结果的相关性分数乘以此系数,使其排序更靠前</p>
|
||||
<label>{{ $t('agentEditor.faq.boostLabel') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.faq.boostDesc') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -820,8 +820,8 @@
|
||||
<!-- 网络搜索配置 -->
|
||||
<div v-show="currentSection === 'websearch'" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.webSearchConfig') || '网络搜索' }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.webSearchConfigDesc') || '配置智能体的网络搜索能力' }}</p>
|
||||
<h2>{{ $t('agent.editor.webSearchConfig') }}</h2>
|
||||
<p class="section-description">{{ $t('agent.editor.webSearchConfigDesc') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
@@ -829,7 +829,7 @@
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.webSearch') }}</label>
|
||||
<p class="desc">启用后智能体可以搜索互联网获取信息</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.webSearch') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="formData.config.web_search_enabled" />
|
||||
@@ -840,7 +840,7 @@
|
||||
<div v-if="formData.config.web_search_enabled" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.webSearchMaxResults') }}</label>
|
||||
<p class="desc">每次搜索返回的最大结果数量</p>
|
||||
<p class="desc">{{ $t('agentEditor.desc.webSearchMaxResults') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -855,16 +855,16 @@
|
||||
<!-- 检索策略(仅在有知识库能力时显示) -->
|
||||
<div v-show="currentSection === 'retrieval' && hasKnowledgeBase" class="section">
|
||||
<div class="section-header">
|
||||
<h2>{{ $t('agent.editor.retrievalStrategy') || '检索策略' }}</h2>
|
||||
<p class="section-description">配置知识库检索和排序的参数</p>
|
||||
<h2>{{ $t('agent.editor.retrievalStrategy') }}</h2>
|
||||
<p class="section-description">{{ $t('agentEditor.desc.retrievalSection') }}</p>
|
||||
</div>
|
||||
|
||||
<div class="settings-group">
|
||||
<!-- 查询扩展(仅普通模式) -->
|
||||
<div v-if="!isAgentMode" class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.enableQueryExpansion') || '查询扩展' }}</label>
|
||||
<p class="desc">自动扩展查询词以提高召回率</p>
|
||||
<label>{{ $t('agent.editor.enableQueryExpansion') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.queryExpansion') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-switch v-model="formData.config.enable_query_expansion" />
|
||||
@@ -874,8 +874,8 @@
|
||||
<!-- 向量召回TopK -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.embeddingTopK') || '向量召回数量' }}</label>
|
||||
<p class="desc">向量检索返回的最大结果数量</p>
|
||||
<label>{{ $t('agent.editor.embeddingTopK') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.embeddingTopK') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-input-number v-model="formData.config.embedding_top_k" :min="1" :max="50" theme="column" />
|
||||
@@ -885,8 +885,8 @@
|
||||
<!-- 关键词阈值 -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.keywordThreshold') || '关键词阈值' }}</label>
|
||||
<p class="desc">关键词检索的最低相关性分数</p>
|
||||
<label>{{ $t('agent.editor.keywordThreshold') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.keywordThreshold') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -899,8 +899,8 @@
|
||||
<!-- 向量阈值 -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.vectorThreshold') || '向量阈值' }}</label>
|
||||
<p class="desc">向量检索的最低相似度分数</p>
|
||||
<label>{{ $t('agent.editor.vectorThreshold') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.vectorThreshold') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -913,8 +913,8 @@
|
||||
<!-- 重排TopK -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.rerankTopK') || '重排数量' }}</label>
|
||||
<p class="desc">重排序后保留的最大结果数量</p>
|
||||
<label>{{ $t('agent.editor.rerankTopK') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.rerankTopK') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-input-number v-model="formData.config.rerank_top_k" :min="1" :max="20" theme="column" />
|
||||
@@ -924,8 +924,8 @@
|
||||
<!-- 重排阈值 -->
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.rerankThreshold') || '重排阈值' }}</label>
|
||||
<p class="desc">重排序的最低相关性分数</p>
|
||||
<label>{{ $t('agent.editor.rerankThreshold') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.rerankThreshold') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<div class="slider-wrapper">
|
||||
@@ -939,13 +939,13 @@
|
||||
<template v-if="!isAgentMode">
|
||||
<div class="setting-row">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.fallbackStrategy') || '兜底策略' }}</label>
|
||||
<p class="desc">当无法从知识库找到相关内容时的处理方式</p>
|
||||
<label>{{ $t('agent.editor.fallbackStrategy') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.fallbackStrategy') }}</p>
|
||||
</div>
|
||||
<div class="setting-control">
|
||||
<t-radio-group v-model="formData.config.fallback_strategy">
|
||||
<t-radio-button value="fixed">固定回复</t-radio-button>
|
||||
<t-radio-button value="model">模型生成</t-radio-button>
|
||||
<t-radio-button value="fixed">{{ $t('agentEditor.fallback.fixed') }}</t-radio-button>
|
||||
<t-radio-button value="model">{{ $t('agentEditor.fallback.model') }}</t-radio-button>
|
||||
</t-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
@@ -953,14 +953,14 @@
|
||||
<!-- 固定兜底回复 -->
|
||||
<div v-if="formData.config.fallback_strategy === 'fixed'" class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.fallbackResponse') || '固定回复内容' }}</label>
|
||||
<p class="desc">当无法回答时返回的固定文本</p>
|
||||
<label>{{ $t('agent.editor.fallbackResponse') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.fallbackResponse') }}</p>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full">
|
||||
<div class="textarea-with-template">
|
||||
<t-textarea
|
||||
v-model="formData.config.fallback_response"
|
||||
:placeholder="defaultFallbackResponse || $t('agent.editor.fallbackResponsePlaceholder') || '抱歉,我无法回答这个问题。'"
|
||||
:placeholder="defaultFallbackResponse || $t('agent.editor.fallbackResponsePlaceholder')"
|
||||
:autosize="{ minRows: 2, maxRows: 6 }"
|
||||
/>
|
||||
<PromptTemplateSelector
|
||||
@@ -975,14 +975,14 @@
|
||||
<!-- 兜底提示词 -->
|
||||
<div v-if="formData.config.fallback_strategy === 'model'" class="setting-row setting-row-vertical">
|
||||
<div class="setting-info">
|
||||
<label>{{ $t('agent.editor.fallbackPrompt') || '兜底提示词' }}</label>
|
||||
<p class="desc">当无法从知识库找到答案时,引导模型生成回复的提示词</p>
|
||||
<label>{{ $t('agent.editor.fallbackPrompt') }}</label>
|
||||
<p class="desc">{{ $t('agentEditor.desc.fallbackPrompt') }}</p>
|
||||
<div class="placeholder-tags" v-if="fallbackPlaceholders.length > 0">
|
||||
<span class="placeholder-label">可用变量:</span>
|
||||
<span class="placeholder-label">{{ $t('agentEditor.placeholders.available') }}</span>
|
||||
<t-tooltip
|
||||
v-for="placeholder in fallbackPlaceholders"
|
||||
:key="placeholder.name"
|
||||
:content="placeholder.description + '(点击插入)'"
|
||||
:content="placeholder.description + $t('agentEditor.placeholders.clickToInsert')"
|
||||
placement="top"
|
||||
>
|
||||
<span
|
||||
@@ -991,7 +991,7 @@
|
||||
v-text="'{{' + placeholder.name + '}}'"
|
||||
></span>
|
||||
</t-tooltip>
|
||||
<span class="placeholder-hint" v-text="'(点击插入,或输入 {{ 唤起列表)'"></span>
|
||||
<span class="placeholder-hint">{{ $t('agentEditor.placeholders.hint') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting-control setting-control-full" style="position: relative;">
|
||||
@@ -999,7 +999,7 @@
|
||||
<t-textarea
|
||||
ref="fallbackPromptTextareaRef"
|
||||
v-model="formData.config.fallback_prompt"
|
||||
:placeholder="defaultFallbackPrompt || $t('agent.editor.fallbackPromptPlaceholder') || '留空使用系统默认提示词'"
|
||||
:placeholder="defaultFallbackPrompt || $t('agent.editor.fallbackPromptPlaceholder')"
|
||||
:autosize="{ minRows: 4, maxRows: 10 }"
|
||||
@input="handleFallbackPromptInput"
|
||||
/>
|
||||
@@ -1133,18 +1133,18 @@ const mcpSelectionMode = ref<'all' | 'selected' | 'none'>('none');
|
||||
const skillsSelectionMode = ref<'all' | 'selected' | 'none'>('none');
|
||||
|
||||
// 可用工具列表 (与后台 definitions.go 保持一致)
|
||||
const allTools = [
|
||||
{ value: 'thinking', label: '思考', description: '动态和反思性的问题解决思考工具', requiresKB: false },
|
||||
{ value: 'todo_write', label: '制定计划', description: '创建结构化的研究计划', requiresKB: false },
|
||||
{ value: 'grep_chunks', label: '关键词搜索', description: '快速定位包含特定关键词的文档和分块', requiresKB: true },
|
||||
{ value: 'knowledge_search', label: '语义搜索', description: '理解问题并查找语义相关内容', requiresKB: true },
|
||||
{ value: 'list_knowledge_chunks', label: '查看文档分块', description: '获取文档完整分块内容', requiresKB: true },
|
||||
{ value: 'query_knowledge_graph', label: '查询知识图谱', description: '从知识图谱中查询关系', requiresKB: true },
|
||||
{ value: 'get_document_info', label: '获取文档信息', description: '查看文档元数据', requiresKB: true },
|
||||
{ value: 'database_query', label: '查询数据库', description: '查询数据库中的信息', requiresKB: true },
|
||||
{ value: 'data_analysis', label: '数据分析', description: '理解数据文件并进行数据分析', requiresKB: true },
|
||||
{ value: 'data_schema', label: '查看数据元信息', description: '获取表格文件的元信息', requiresKB: true },
|
||||
];
|
||||
const allTools = computed(() => [
|
||||
{ value: 'thinking', label: t('agentEditor.tools.thinking'), description: t('agentEditor.tools.thinkingDesc'), requiresKB: false },
|
||||
{ value: 'todo_write', label: t('agentEditor.tools.todoWrite'), description: t('agentEditor.tools.todoWriteDesc'), requiresKB: false },
|
||||
{ value: 'grep_chunks', label: t('agentEditor.tools.grepChunks'), description: t('agentEditor.tools.grepChunksDesc'), requiresKB: true },
|
||||
{ value: 'knowledge_search', label: t('agentEditor.tools.knowledgeSearch'), description: t('agentEditor.tools.knowledgeSearchDesc'), requiresKB: true },
|
||||
{ value: 'list_knowledge_chunks', label: t('agentEditor.tools.listChunks'), description: t('agentEditor.tools.listChunksDesc'), requiresKB: true },
|
||||
{ value: 'query_knowledge_graph', label: t('agentEditor.tools.queryGraph'), description: t('agentEditor.tools.queryGraphDesc'), requiresKB: true },
|
||||
{ value: 'get_document_info', label: t('agentEditor.tools.getDocInfo'), description: t('agentEditor.tools.getDocInfoDesc'), requiresKB: true },
|
||||
{ value: 'database_query', label: t('agentEditor.tools.dbQuery'), description: t('agentEditor.tools.dbQueryDesc'), requiresKB: true },
|
||||
{ value: 'data_analysis', label: t('agentEditor.tools.dataAnalysis'), description: t('agentEditor.tools.dataAnalysisDesc'), requiresKB: true },
|
||||
{ value: 'data_schema', label: t('agentEditor.tools.dataSchema'), description: t('agentEditor.tools.dataSchemaDesc'), requiresKB: true },
|
||||
]);
|
||||
|
||||
// 知识库分组:我的 vs 共享的
|
||||
const myKbOptions = computed(() => kbOptions.value.filter(kb => !kb.shared));
|
||||
@@ -1176,13 +1176,13 @@ const availableTools = computed(() => {
|
||||
|
||||
// 可用文件类型列表
|
||||
const availableFileTypes = [
|
||||
{ value: 'pdf', label: 'PDF', description: 'PDF 文档' },
|
||||
{ value: 'docx', label: 'Word', description: 'Word 文档 (.docx/.doc)' },
|
||||
{ value: 'txt', label: '文本', description: '纯文本文件 (.txt)' },
|
||||
{ value: 'md', label: 'Markdown', description: 'Markdown 文档' },
|
||||
{ value: 'csv', label: 'CSV', description: '逗号分隔值文件' },
|
||||
{ value: 'xlsx', label: 'Excel', description: 'Excel 表格 (.xlsx/.xls)' },
|
||||
{ value: 'jpg', label: '图片', description: '图片文件 (.jpg/.jpeg/.png)' },
|
||||
{ value: 'pdf', label: 'PDF', description: t('agentEditor.fileTypes.pdf') },
|
||||
{ value: 'docx', label: 'Word', description: t('agentEditor.fileTypes.word') },
|
||||
{ value: 'txt', label: t('agentEditor.fileTypes.textLabel'), description: t('agentEditor.fileTypes.text') },
|
||||
{ value: 'md', label: 'Markdown', description: t('agentEditor.fileTypes.markdown') },
|
||||
{ value: 'csv', label: 'CSV', description: t('agentEditor.fileTypes.csv') },
|
||||
{ value: 'xlsx', label: 'Excel', description: t('agentEditor.fileTypes.excel') },
|
||||
{ value: 'jpg', label: t('agentEditor.fileTypes.imageLabel'), description: t('agentEditor.fileTypes.image') },
|
||||
];
|
||||
|
||||
// 占位符相关 - 从 API 获取
|
||||
@@ -1265,10 +1265,10 @@ const navItems = computed(() => {
|
||||
{ key: 'model', icon: 'control-platform', label: t('agent.editor.modelConfig') },
|
||||
];
|
||||
// 知识库配置(放在工具上面)
|
||||
items.push({ key: 'knowledge', icon: 'folder', label: t('agent.editor.knowledgeConfig') || '知识库' });
|
||||
items.push({ key: 'knowledge', icon: 'folder', label: t('agent.editor.knowledgeConfig') });
|
||||
// Agent模式才显示工具配置
|
||||
if (isAgentMode.value) {
|
||||
items.push({ key: 'tools', icon: 'tools', label: t('agent.editor.toolsConfig') || '工具配置' });
|
||||
items.push({ key: 'tools', icon: 'tools', label: t('agent.editor.toolsConfig') });
|
||||
}
|
||||
// Agent 模式且沙箱已启用时才显示 Skills 配置(disabled 时无法启用 Skills)
|
||||
if (isAgentMode.value && skillsAvailable.value) {
|
||||
@@ -1276,17 +1276,17 @@ const navItems = computed(() => {
|
||||
}
|
||||
// 有知识库能力时才显示检索策略
|
||||
if (hasKnowledgeBase.value) {
|
||||
items.push({ key: 'retrieval', icon: 'search', label: t('agent.editor.retrievalStrategy') || '检索策略' });
|
||||
items.push({ key: 'retrieval', icon: 'search', label: t('agent.editor.retrievalStrategy') });
|
||||
}
|
||||
// 网络搜索(独立菜单)
|
||||
items.push({ key: 'websearch', icon: 'internet', label: t('agent.editor.webSearchConfig') || '网络搜索' });
|
||||
items.push({ key: 'websearch', icon: 'internet', label: t('agent.editor.webSearchConfig') });
|
||||
// 多轮对话(仅普通模式显示,Agent模式内部自动控制)
|
||||
if (!isAgentMode.value) {
|
||||
items.push({ key: 'conversation', icon: 'chat', label: t('agent.editor.conversationSettings') || '多轮对话' });
|
||||
items.push({ key: 'conversation', icon: 'chat', label: t('agent.editor.conversationSettings') });
|
||||
}
|
||||
// 共享管理(仅编辑模式且非内置智能体)
|
||||
if (props.mode === 'edit' && props.agent?.id && !props.agent?.is_builtin) {
|
||||
items.push({ key: 'share', icon: 'share', label: t('knowledgeEditor.sidebar.share') || '共享管理' });
|
||||
items.push({ key: 'share', icon: 'share', label: t('knowledgeEditor.sidebar.share') });
|
||||
}
|
||||
return items;
|
||||
});
|
||||
@@ -2573,12 +2573,12 @@ const handleSave = async () => {
|
||||
if (!isAgentMode.value && hasKnowledgeBase.value) {
|
||||
const contextTemplate = formData.value.config.context_template || '';
|
||||
if (!hasPlaceholder(contextTemplate, 'contexts')) {
|
||||
MessagePlugin.error(t('agent.editor.contextsMissing') || '开启知识库时,上下文模板必须包含 {{contexts}} 占位符');
|
||||
MessagePlugin.error(t('agent.editor.contextsMissing'));
|
||||
currentSection.value = 'basic';
|
||||
return;
|
||||
}
|
||||
if (!hasPlaceholder(contextTemplate, 'query')) {
|
||||
MessagePlugin.error(t('agent.editor.queryMissingInContext') || '上下文模板必须包含 {{query}} 占位符');
|
||||
MessagePlugin.error(t('agent.editor.queryMissingInContext'));
|
||||
currentSection.value = 'basic';
|
||||
return;
|
||||
}
|
||||
@@ -2588,7 +2588,7 @@ const handleSave = async () => {
|
||||
if (isAgentMode.value && hasKnowledgeBase.value) {
|
||||
const systemPrompt = formData.value.config.system_prompt || '';
|
||||
if (!hasPlaceholder(systemPrompt, 'knowledge_bases')) {
|
||||
MessagePlugin.warning(t('agent.editor.knowledgeBasesMissing') || '建议在系统提示词中包含 {{knowledge_bases}} 占位符,以便模型了解可用的知识库');
|
||||
MessagePlugin.warning(t('agent.editor.knowledgeBasesMissing'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2598,12 +2598,12 @@ const handleSave = async () => {
|
||||
// 只有用户自定义了改写提示词时才校验
|
||||
if (rewritePrompt.trim()) {
|
||||
if (!hasPlaceholder(rewritePrompt, 'query')) {
|
||||
MessagePlugin.error(t('agent.editor.queryMissingInRewrite') || '改写用户提示词必须包含 {{query}} 占位符');
|
||||
MessagePlugin.error(t('agent.editor.queryMissingInRewrite'));
|
||||
currentSection.value = 'conversation';
|
||||
return;
|
||||
}
|
||||
if (!hasPlaceholder(rewritePrompt, 'conversation')) {
|
||||
MessagePlugin.error(t('agent.editor.conversationMissing') || '改写用户提示词必须包含 {{conversation}} 占位符');
|
||||
MessagePlugin.error(t('agent.editor.conversationMissing'));
|
||||
currentSection.value = 'conversation';
|
||||
return;
|
||||
}
|
||||
@@ -2615,7 +2615,7 @@ const handleSave = async () => {
|
||||
const fallbackPrompt = formData.value.config.fallback_prompt || '';
|
||||
// 只有用户自定义了兜底提示词时才校验
|
||||
if (fallbackPrompt.trim() && !hasPlaceholder(fallbackPrompt, 'query')) {
|
||||
MessagePlugin.error(t('agent.editor.queryMissingInFallback') || '兜底提示词必须包含 {{query}} 占位符');
|
||||
MessagePlugin.error(t('agent.editor.queryMissingInFallback'));
|
||||
currentSection.value = 'retrieval';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -461,25 +461,25 @@
|
||||
<div v-if="sharedDetailVisible && currentSharedAgent" class="shared-detail-drawer-overlay" @click.self="closeSharedAgentDetail">
|
||||
<div class="shared-detail-drawer">
|
||||
<div class="shared-detail-drawer-header">
|
||||
<h3 class="shared-detail-drawer-title">{{ $t('agent.detail.title') || '智能体详情' }}</h3>
|
||||
<h3 class="shared-detail-drawer-title">{{ $t('agent.detail.title') }}</h3>
|
||||
<button type="button" class="shared-detail-drawer-close" @click="closeSharedAgentDetail" :aria-label="$t('general.close')">
|
||||
<t-icon name="close" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="shared-detail-drawer-body">
|
||||
<div class="shared-detail-row">
|
||||
<span class="shared-detail-label">{{ $t('agent.editor.name') || '名称' }}</span>
|
||||
<span class="shared-detail-label">{{ $t('agent.editor.name') }}</span>
|
||||
<span class="shared-detail-value">{{ currentSharedAgent.agent?.name }}</span>
|
||||
</div>
|
||||
<div class="shared-detail-row">
|
||||
<span class="shared-detail-label">{{ $t('knowledgeList.detail.sourceOrg') || '来源空间' }}</span>
|
||||
<span class="shared-detail-label">{{ $t('knowledgeList.detail.sourceOrg') }}</span>
|
||||
<span class="shared-detail-value shared-detail-org">
|
||||
<img src="@/assets/img/organization-green.svg" class="shared-detail-org-icon" alt="" aria-hidden="true" />
|
||||
<span>{{ currentSharedAgent.org_name }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="shared-detail-row">
|
||||
<span class="shared-detail-label">{{ $t('knowledgeList.detail.myPermission') || '我的权限' }}</span>
|
||||
<span class="shared-detail-label">{{ $t('knowledgeList.detail.myPermission') }}</span>
|
||||
<span class="shared-detail-value">{{ $t('organization.share.permissionReadonly') }}</span>
|
||||
</div>
|
||||
<!-- 能力范围(与共享范围说明一致) -->
|
||||
@@ -509,7 +509,7 @@
|
||||
</div>
|
||||
<div class="shared-detail-drawer-footer">
|
||||
<t-button theme="primary" block @click="handleUseSharedAgentInChat(currentSharedAgent)">
|
||||
{{ $t('agent.detail.useInChat') || '在对话中使用' }}
|
||||
{{ $t('agent.detail.useInChat') }}
|
||||
</t-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -796,11 +796,11 @@ async function handleUseSharedAgentInChat(shared: SharedAgentInfo) {
|
||||
query: { agent_id: shared.agent.id, source_tenant_id: String(shared.source_tenant_id) }
|
||||
})
|
||||
} else {
|
||||
MessagePlugin.error(t('createChat.messages.createFailed') || '创建会话失败')
|
||||
MessagePlugin.error(t('createChat.messages.createFailed'))
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Create session for shared agent failed', e)
|
||||
MessagePlugin.error(t('createChat.messages.createError') || '创建会话出错')
|
||||
MessagePlugin.error(t('createChat.messages.createError'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user