feat: add support for Graph Tools in AIAgent model and related services
This commit is contained in:
@@ -56,6 +56,7 @@ type CreateAIAgentRequest struct {
|
||||
KnowledgeIDs []int64 `json:"knowledgeIds"`
|
||||
SkillIDs []int64 `json:"skillIds"`
|
||||
DirectTools []AIAgentMCPToolRequest `json:"directTools"`
|
||||
GraphTools []string `json:"graphTools"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ type AIAgentResponse struct {
|
||||
SkillIDs []int64 `json:"skillIds"`
|
||||
Skills []AIAgentSkillResponse `json:"skills"`
|
||||
DirectTools []AIAgentMCPToolResponse `json:"directTools"`
|
||||
GraphTools []string `json:"graphTools"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
|
||||
@@ -281,6 +281,12 @@ func IsAgentDirectToolCode(toolCode string) bool {
|
||||
return ok && spec.DirectAccess
|
||||
}
|
||||
|
||||
func IsAgentDirectGraphToolCode(toolCode string) bool {
|
||||
toolCode = NormalizeToolCodeAlias(strings.TrimSpace(toolCode))
|
||||
spec, ok := GetRegisteredToolSpec(toolCode)
|
||||
return ok && spec.DirectAccess && spec.SourceType == enums.ToolSourceTypeGraph
|
||||
}
|
||||
|
||||
func NormalizeToolCodeAlias(toolCode string) string {
|
||||
toolCode = strings.TrimSpace(toolCode)
|
||||
if canonical, ok := toolAliasToCanonical[toolCode]; ok {
|
||||
|
||||
Reference in New Issue
Block a user