feat: 新增MCP服务功能支持,优化智能体特性标识显示;调整内置智能体排序逻辑,确保智能体模式下自动启用多轮对话
This commit is contained in:
@@ -241,6 +241,7 @@ export default {
|
|||||||
features: {
|
features: {
|
||||||
webSearch: 'Web Search Enabled',
|
webSearch: 'Web Search Enabled',
|
||||||
knowledgeBase: 'Knowledge Base Linked',
|
knowledgeBase: 'Knowledge Base Linked',
|
||||||
|
mcp: 'MCP Services Enabled',
|
||||||
multiTurn: 'Multi-turn Conversation',
|
multiTurn: 'Multi-turn Conversation',
|
||||||
},
|
},
|
||||||
empty: {
|
empty: {
|
||||||
|
|||||||
@@ -771,6 +771,7 @@ export default {
|
|||||||
features: {
|
features: {
|
||||||
webSearch: "支持网络搜索",
|
webSearch: "支持网络搜索",
|
||||||
knowledgeBase: "关联知识库",
|
knowledgeBase: "关联知识库",
|
||||||
|
mcp: "支持MCP服务",
|
||||||
multiTurn: "多轮对话",
|
multiTurn: "多轮对话",
|
||||||
},
|
},
|
||||||
empty: {
|
empty: {
|
||||||
|
|||||||
@@ -95,17 +95,27 @@
|
|||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
<t-tooltip v-if="agent.config?.web_search_enabled" :content="$t('agent.features.webSearch')" placement="top">
|
<t-tooltip v-if="agent.config?.web_search_enabled" :content="$t('agent.features.webSearch')" placement="top">
|
||||||
<div class="feature-badge web-search">
|
<div class="feature-badge web-search">
|
||||||
<t-icon name="search" size="14px" />
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<circle cx="8" cy="8" r="6" stroke="currentColor" stroke-width="1.2" fill="none"/>
|
||||||
|
<ellipse cx="8" cy="8" rx="2.5" ry="6" stroke="currentColor" stroke-width="1.2" fill="none"/>
|
||||||
|
<line x1="2" y1="6" x2="14" y2="6" stroke="currentColor" stroke-width="1.2"/>
|
||||||
|
<line x1="2" y1="10" x2="14" y2="10" stroke="currentColor" stroke-width="1.2"/>
|
||||||
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
<t-tooltip v-if="agent.config?.knowledge_bases?.length" :content="$t('agent.features.knowledgeBase')" placement="top">
|
<t-tooltip v-if="agent.config?.knowledge_bases?.length || agent.config?.kb_selection_mode === 'all'" :content="$t('agent.features.knowledgeBase')" placement="top">
|
||||||
<div class="feature-badge knowledge">
|
<div class="feature-badge knowledge">
|
||||||
<t-icon name="folder" size="14px" />
|
<t-icon name="folder" size="16px" />
|
||||||
|
</div>
|
||||||
|
</t-tooltip>
|
||||||
|
<t-tooltip v-if="agent.config?.mcp_services?.length || agent.config?.mcp_selection_mode === 'all'" :content="$t('agent.features.mcp')" placement="top">
|
||||||
|
<div class="feature-badge mcp">
|
||||||
|
<t-icon name="extension" size="16px" />
|
||||||
</div>
|
</div>
|
||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
<t-tooltip v-if="agent.config?.multi_turn_enabled" :content="$t('agent.features.multiTurn')" placement="top">
|
<t-tooltip v-if="agent.config?.multi_turn_enabled" :content="$t('agent.features.multiTurn')" placement="top">
|
||||||
<div class="feature-badge multi-turn">
|
<div class="feature-badge multi-turn">
|
||||||
<t-icon name="chat-bubble" size="14px" />
|
<t-icon name="chat-bubble" size="16px" />
|
||||||
</div>
|
</div>
|
||||||
</t-tooltip>
|
</t-tooltip>
|
||||||
</div>
|
</div>
|
||||||
@@ -658,6 +668,15 @@ defineExpose({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.mcp {
|
||||||
|
background: rgba(236, 72, 153, 0.08);
|
||||||
|
color: #ec4899;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(236, 72, 153, 0.12);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.multi-turn {
|
&.multi-turn {
|
||||||
background: rgba(59, 130, 246, 0.08);
|
background: rgba(59, 130, 246, 0.08);
|
||||||
color: #3b82f6;
|
color: #3b82f6;
|
||||||
|
|||||||
@@ -195,6 +195,10 @@ func (a *CustomAgent) EnsureDefaults() {
|
|||||||
if a.Config.MaxCompletionTokens == 0 {
|
if a.Config.MaxCompletionTokens == 0 {
|
||||||
a.Config.MaxCompletionTokens = 2048
|
a.Config.MaxCompletionTokens = 2048
|
||||||
}
|
}
|
||||||
|
// Agent mode should always enable multi-turn conversation
|
||||||
|
if a.Config.AgentMode == AgentModeSmartReasoning {
|
||||||
|
a.Config.MultiTurnEnabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsAgentMode returns true if this agent uses ReAct agent mode
|
// IsAgentMode returns true if this agent uses ReAct agent mode
|
||||||
@@ -281,13 +285,15 @@ var BuiltinAgentRegistry = map[string]func(uint64) *CustomAgent{
|
|||||||
BuiltinSmartReasoningID: GetBuiltinSmartReasoningAgent,
|
BuiltinSmartReasoningID: GetBuiltinSmartReasoningAgent,
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBuiltinAgentIDs returns all built-in agent IDs
|
// builtinAgentIDsOrdered defines the fixed display order of built-in agents
|
||||||
|
var builtinAgentIDsOrdered = []string{
|
||||||
|
BuiltinQuickAnswerID,
|
||||||
|
BuiltinSmartReasoningID,
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetBuiltinAgentIDs returns all built-in agent IDs in fixed order
|
||||||
func GetBuiltinAgentIDs() []string {
|
func GetBuiltinAgentIDs() []string {
|
||||||
ids := make([]string, 0, len(BuiltinAgentRegistry))
|
return builtinAgentIDsOrdered
|
||||||
for id := range BuiltinAgentRegistry {
|
|
||||||
ids = append(ids, id)
|
|
||||||
}
|
|
||||||
return ids
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsBuiltinAgentID checks if the given ID is a built-in agent ID
|
// IsBuiltinAgentID checks if the given ID is a built-in agent ID
|
||||||
|
|||||||
Reference in New Issue
Block a user