feat: refactor ticket creation process to use Graph Tool for confirmation and state management
This commit is contained in:
@@ -6,6 +6,11 @@ const (
|
||||
BuiltinToolSearchToolName = "tool_search"
|
||||
BuiltinToolSearchToolTitle = "搜索并调用动态工具"
|
||||
BuiltinToolSearchToolDescription = "用于搜索当前允许使用的 MCP 工具,并在确认目标 toolCode 后动态调用该工具。适合处理长尾工具,不应替代固定内置流程工具。"
|
||||
GraphToolCatalogServerCode = "graph"
|
||||
GraphCreateTicketConfirmToolCode = "graph/create_ticket_with_confirmation"
|
||||
GraphCreateTicketConfirmToolName = "create_ticket_with_confirmation"
|
||||
GraphCreateTicketConfirmToolTitle = "创建工单确认流程"
|
||||
GraphCreateTicketConfirmToolDescription = "Graph Tool。用于封装建单参数整理、用户确认、真正建单和结果返回的确定性流程。"
|
||||
BuiltinCreateTicketConfirmToolCode = "builtin/create_ticket_with_confirmation"
|
||||
BuiltinCreateTicketConfirmToolName = "create_ticket_with_confirmation"
|
||||
BuiltinCreateTicketConfirmToolTitle = "创建工单并发起确认"
|
||||
@@ -15,3 +20,12 @@ const (
|
||||
func IsAutoInjectedToolCode(toolCode string) bool {
|
||||
return toolCode == BuiltinToolSearchToolCode
|
||||
}
|
||||
|
||||
func NormalizeToolCodeAlias(toolCode string) string {
|
||||
switch toolCode {
|
||||
case BuiltinCreateTicketConfirmToolCode:
|
||||
return GraphCreateTicketConfirmToolCode
|
||||
default:
|
||||
return toolCode
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ func SplitMCPToolCode(toolCode string) (string, string) {
|
||||
|
||||
func NormalizeMCPToolRequest(item request.AIAgentMCPToolRequest) (request.AIAgentMCPToolRequest, error) {
|
||||
toolCode := strings.TrimSpace(item.ToolCode)
|
||||
toolCode = NormalizeToolCodeAlias(toolCode)
|
||||
serverCode := strings.TrimSpace(item.ServerCode)
|
||||
toolName := strings.TrimSpace(item.ToolName)
|
||||
if toolCode != "" {
|
||||
|
||||
Reference in New Issue
Block a user