Package com.tnsai.agents.groups
Class AgentGroupBuilder
java.lang.Object
com.tnsai.agents.groups.AgentGroupBuilder
Builder for creating AgentGroup instances.
Usage Example
AgentGroup group = AgentGroup.builder()
.name("Research Team")
.description("Team for document analysis")
.policy(GroupPolicy.builder()
.maxMembers(5)
.build())
.member(agent1)
.member(agent2)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionautoStart(boolean autoStart) Sets whether to auto-start after build.build()Builds the AgentGroup.description(String description) Sets the group description.Sets the group ID.Adds an initial member.Adds multiple initial members.Sets the group name.policy(GroupPolicy policy) Sets the group policy.
-
Method Details
-
id
Sets the group ID.- Parameters:
id- group ID- Returns:
- this builder
-
name
Sets the group name.- Parameters:
name- group name- Returns:
- this builder
-
description
Sets the group description.- Parameters:
description- group description- Returns:
- this builder
-
policy
Sets the group policy.- Parameters:
policy- group policy- Returns:
- this builder
-
member
Adds an initial member.- Parameters:
agent- agent to add- Returns:
- this builder
-
members
Adds multiple initial members.- Parameters:
agents- agents to add- Returns:
- this builder
-
autoStart
Sets whether to auto-start after build.- Parameters:
autoStart- auto-start flag- Returns:
- this builder
-
build
Builds the AgentGroup.- Returns:
- new AgentGroup instance
-