Class AgentSpecReactAgentFactory
java.lang.Object
com.alibaba.cloud.ai.graph.agent.tools.task.AgentSpecReactAgentFactory
Factory that converts
AgentSpec into ReactAgent instances.
Use this when loading agent specs from files - the factory creates ReactAgents with the spec's system prompt and optionally filtered tools.
AgentSpecReactAgentFactory factory = AgentSpecReactAgentFactory.builder()
.chatModel(chatModel)
.defaultTools(grepTool, globTool, readTool)
.build();
List<AgentSpec> specs = AgentSpecLoader.loadFromDirectory(".claude/agents");
Map<String, ReactAgent> subAgents = new HashMap<>();
for (AgentSpec spec : specs) {
subAgents.put(spec.name(), factory.create(spec));
}
- Author:
- Spring AI Alibaba
-
Nested Class Summary
Nested Classes -
Method Summary
-
Method Details
-
create
Create a ReactAgent from this spec. -
builder
-