refactor: enhance MCP server configuration tooltips and validation messages
--bug=1054206 --user=刘瑞斌 【应用】MCP节点不配置Server config,不选择工具,可以发布应用,对话时报错 https://www.tapd.cn/57709429/s/1679457
This commit is contained in:
parent
5b2baaf04d
commit
fb0fdb9c85
@ -228,6 +228,7 @@ export default {
|
|||||||
tool: 'Tool',
|
tool: 'Tool',
|
||||||
toolParam: 'Tool Params',
|
toolParam: 'Tool Params',
|
||||||
mcpServerTip: 'Please enter the JSON format of the MCP server config',
|
mcpServerTip: 'Please enter the JSON format of the MCP server config',
|
||||||
|
mcpToolTip: 'Please select a tool',
|
||||||
configLabel: 'MCP Server Config (Only supports SSE call method)',
|
configLabel: 'MCP Server Config (Only supports SSE call method)',
|
||||||
},
|
},
|
||||||
imageGenerateNode: {
|
imageGenerateNode: {
|
||||||
|
|||||||
@ -227,7 +227,8 @@ export default {
|
|||||||
getTool: '获取工具',
|
getTool: '获取工具',
|
||||||
tool: '工具',
|
tool: '工具',
|
||||||
toolParam: '工具参数',
|
toolParam: '工具参数',
|
||||||
mcpServerTip: '请输入 JSON 格式的 MCP 服务器配置',
|
mcpServerTip: '请输入JSON格式的MCP服务器配置',
|
||||||
|
mcpToolTip: '请选择工具',
|
||||||
configLabel: 'MCP Server Config (仅支持SSE调用方式)'
|
configLabel: 'MCP Server Config (仅支持SSE调用方式)'
|
||||||
},
|
},
|
||||||
imageGenerateNode: {
|
imageGenerateNode: {
|
||||||
|
|||||||
@ -227,7 +227,8 @@ export default {
|
|||||||
getTool: '獲取工具',
|
getTool: '獲取工具',
|
||||||
tool: '工具',
|
tool: '工具',
|
||||||
toolParam: '工具變數',
|
toolParam: '工具變數',
|
||||||
mcpServerTip: '請輸入 JSON 格式的 MCP 服務器配置',
|
mcpServerTip: '請輸入JSON格式的MCP服務器配置',
|
||||||
|
mcpToolTip: '請選擇工具',
|
||||||
configLabel: 'MCP Server Config (僅支持SSE調用方式)',
|
configLabel: 'MCP Server Config (僅支持SSE調用方式)',
|
||||||
},
|
},
|
||||||
imageGenerateNode: {
|
imageGenerateNode: {
|
||||||
|
|||||||
@ -343,10 +343,21 @@ const validate = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let ps = [replyNodeFormRef.value?.validate()]
|
if (replyNodeFormRef.value) {
|
||||||
return Promise.all(ps).catch((err: any) => {
|
const form = cloneDeep(form_data.value)
|
||||||
return Promise.reject({ node: props.nodeModel, errMessage: err })
|
if (!form.mcp_servers) {
|
||||||
})
|
return Promise.reject({
|
||||||
|
node: props.nodeModel,
|
||||||
|
errMessage: t('views.applicationWorkflow.nodes.mcpNode.mcpServerTip')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!form.mcp_tool) {
|
||||||
|
return Promise.reject({
|
||||||
|
node: props.nodeModel,
|
||||||
|
errMessage: t('views.applicationWorkflow.nodes.mcpNode.mcpToolTip')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user