feat: bind AI agents to workflow versions

This commit is contained in:
mlogclub
2026-06-22 00:14:36 +08:00
parent 3267a4ce5c
commit df7b199c18
7 changed files with 192 additions and 0 deletions
+2
View File
@@ -58,6 +58,8 @@ type CreateAIAgentRequest struct {
SkillIDs []int64 `json:"skillIds"`
DirectTools []AIAgentMCPToolRequest `json:"directTools"`
GraphTools []string `json:"graphTools"`
RuntimeMode enums.AIAgentRuntimeMode `json:"runtimeMode"`
WorkflowVersionID int64 `json:"workflowVersionId"`
}
type UpdateAIAgentRequest struct {
+3
View File
@@ -91,6 +91,9 @@ type AIAgentResponse struct {
Skills []AIAgentSkillResponse `json:"skills"`
DirectTools []AIAgentMCPToolResponse `json:"directTools"`
GraphTools []string `json:"graphTools"`
RuntimeMode enums.AIAgentRuntimeMode `json:"runtimeMode"`
RuntimeModeName string `json:"runtimeModeName"`
WorkflowVersionID int64 `json:"workflowVersionId"`
SortNo int `json:"sortNo"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
+21
View File
@@ -31,3 +31,24 @@ var aiModelTypeLabelMap = map[AIModelType]string{
func GetAIModelTypeLabel(modelType AIModelType) string {
return aiModelTypeLabelMap[modelType]
}
type AIAgentRuntimeMode int
const (
AIAgentRuntimeModeBuiltinGraph AIAgentRuntimeMode = 1
AIAgentRuntimeModeWorkflow AIAgentRuntimeMode = 2
)
var AIAgentRuntimeModeValues = []AIAgentRuntimeMode{
AIAgentRuntimeModeBuiltinGraph,
AIAgentRuntimeModeWorkflow,
}
var aiAgentRuntimeModeLabelMap = map[AIAgentRuntimeMode]string{
AIAgentRuntimeModeBuiltinGraph: "内置 Graph",
AIAgentRuntimeModeWorkflow: "会话流程",
}
func GetAIAgentRuntimeModeLabel(mode AIAgentRuntimeMode) string {
return aiAgentRuntimeModeLabelMap[mode]
}