|
| 1 | +/* |
| 2 | + * Copyright 2024-2025 the original author or authors. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package com.alibaba.cloud.ai.studio.admin.generator.model.agent; |
| 17 | + |
| 18 | +import java.util.List; |
| 19 | +import java.util.Map; |
| 20 | + |
| 21 | +/** |
| 22 | + * @author yHong |
| 23 | + * @version 1.0 |
| 24 | + * @since 2025/8/25 17:28 |
| 25 | + */ |
| 26 | +public class Agent { |
| 27 | + |
| 28 | + // 基础属性 |
| 29 | + private String agentClass; // ReactAgent, SequentialAgent, ParallelAgent.etc |
| 30 | + |
| 31 | + private String name; |
| 32 | + |
| 33 | + private String description; |
| 34 | + |
| 35 | + private String outputKey; |
| 36 | + |
| 37 | + private String inputKey; |
| 38 | + |
| 39 | + // 支持多输入键(与 schema: input_keys 对齐) |
| 40 | + private List<String> inputKeys; |
| 41 | + |
| 42 | + // LLM相关配置 |
| 43 | + private String model; |
| 44 | + |
| 45 | + private String instruction; |
| 46 | + |
| 47 | + private Integer maxIterations; |
| 48 | + |
| 49 | + private Map<String, Object> chatOptions; |
| 50 | + |
| 51 | + // 工具配置 |
| 52 | + private List<String> tools; |
| 53 | + |
| 54 | + private Map<String, Object> toolConfig; |
| 55 | + |
| 56 | + // 子agent配置 |
| 57 | + private List<Agent> subAgents; |
| 58 | + |
| 59 | + // 流程控制配置 |
| 60 | + private Map<String, Object> flowConfig; |
| 61 | + |
| 62 | + // 状态管理配置 |
| 63 | + private Map<String, String> stateConfig; |
| 64 | + |
| 65 | + // 钩子配置 |
| 66 | + private Map<String, Object> hooks; |
| 67 | + |
| 68 | + // 动态 handle:原样透传每种 agent type 的专属配置 |
| 69 | + private Map<String, Object> handle; |
| 70 | + |
| 71 | + public Agent() { |
| 72 | + } |
| 73 | + |
| 74 | + public String getAgentClass() { |
| 75 | + return agentClass; |
| 76 | + } |
| 77 | + |
| 78 | + public void setAgentClass(String agentClass) { |
| 79 | + this.agentClass = agentClass; |
| 80 | + } |
| 81 | + |
| 82 | + public String getName() { |
| 83 | + return name; |
| 84 | + } |
| 85 | + |
| 86 | + public void setName(String name) { |
| 87 | + this.name = name; |
| 88 | + } |
| 89 | + |
| 90 | + public String getDescription() { |
| 91 | + return description; |
| 92 | + } |
| 93 | + |
| 94 | + public void setDescription(String description) { |
| 95 | + this.description = description; |
| 96 | + } |
| 97 | + |
| 98 | + public String getOutputKey() { |
| 99 | + return outputKey; |
| 100 | + } |
| 101 | + |
| 102 | + public void setOutputKey(String outputKey) { |
| 103 | + this.outputKey = outputKey; |
| 104 | + } |
| 105 | + |
| 106 | + public String getInputKey() { |
| 107 | + return inputKey; |
| 108 | + } |
| 109 | + |
| 110 | + public void setInputKey(String inputKey) { |
| 111 | + this.inputKey = inputKey; |
| 112 | + } |
| 113 | + |
| 114 | + public List<String> getInputKeys() { |
| 115 | + return inputKeys; |
| 116 | + } |
| 117 | + |
| 118 | + public void setInputKeys(List<String> inputKeys) { |
| 119 | + this.inputKeys = inputKeys; |
| 120 | + } |
| 121 | + |
| 122 | + public String getModel() { |
| 123 | + return model; |
| 124 | + } |
| 125 | + |
| 126 | + public void setModel(String model) { |
| 127 | + this.model = model; |
| 128 | + } |
| 129 | + |
| 130 | + public String getInstruction() { |
| 131 | + return instruction; |
| 132 | + } |
| 133 | + |
| 134 | + public void setInstruction(String instruction) { |
| 135 | + this.instruction = instruction; |
| 136 | + } |
| 137 | + |
| 138 | + public Integer getMaxIterations() { |
| 139 | + return maxIterations; |
| 140 | + } |
| 141 | + |
| 142 | + public void setMaxIterations(Integer maxIterations) { |
| 143 | + this.maxIterations = maxIterations; |
| 144 | + } |
| 145 | + |
| 146 | + public Map<String, Object> getChatOptions() { |
| 147 | + return chatOptions; |
| 148 | + } |
| 149 | + |
| 150 | + public void setChatOptions(Map<String, Object> chatOptions) { |
| 151 | + this.chatOptions = chatOptions; |
| 152 | + } |
| 153 | + |
| 154 | + public List<String> getTools() { |
| 155 | + return tools; |
| 156 | + } |
| 157 | + |
| 158 | + public void setTools(List<String> tools) { |
| 159 | + this.tools = tools; |
| 160 | + } |
| 161 | + |
| 162 | + public Map<String, Object> getToolConfig() { |
| 163 | + return toolConfig; |
| 164 | + } |
| 165 | + |
| 166 | + public void setToolConfig(Map<String, Object> toolConfig) { |
| 167 | + this.toolConfig = toolConfig; |
| 168 | + } |
| 169 | + |
| 170 | + public List<Agent> getSubAgents() { |
| 171 | + return subAgents; |
| 172 | + } |
| 173 | + |
| 174 | + public void setSubAgents(List<Agent> subAgents) { |
| 175 | + this.subAgents = subAgents; |
| 176 | + } |
| 177 | + |
| 178 | + public Map<String, Object> getFlowConfig() { |
| 179 | + return flowConfig; |
| 180 | + } |
| 181 | + |
| 182 | + public void setFlowConfig(Map<String, Object> flowConfig) { |
| 183 | + this.flowConfig = flowConfig; |
| 184 | + } |
| 185 | + |
| 186 | + public Map<String, String> getStateConfig() { |
| 187 | + return stateConfig; |
| 188 | + } |
| 189 | + |
| 190 | + public void setStateConfig(Map<String, String> stateConfig) { |
| 191 | + this.stateConfig = stateConfig; |
| 192 | + } |
| 193 | + |
| 194 | + public Map<String, Object> getHooks() { |
| 195 | + return hooks; |
| 196 | + } |
| 197 | + |
| 198 | + public void setHooks(Map<String, Object> hooks) { |
| 199 | + this.hooks = hooks; |
| 200 | + } |
| 201 | + |
| 202 | + public Map<String, Object> getHandle() { |
| 203 | + return handle; |
| 204 | + } |
| 205 | + |
| 206 | + public void setHandle(Map<String, Object> handle) { |
| 207 | + this.handle = handle; |
| 208 | + } |
| 209 | + |
| 210 | +} |
0 commit comments