Class AgentsOptions.Builder
java.lang.Object
com.google.genkit.plugins.middleware.AgentsOptions.Builder
- Enclosing class:
AgentsOptions
Builder for
AgentsOptions.-
Method Summary
Modifier and TypeMethodDescriptionAdds sub-agents fromAgentRefs (usesAgentRef.getName()).Sets the sub-agent names (required, at least one).Sets the sub-agent names (required, at least one).artifactStrategy(ArtifactStrategy artifactStrategy) Sets the artifact strategy (defaultArtifactStrategy.INLINE).build()Builds theAgentsOptions.historyLength(int historyLength) Sets the trailing parent-history length to forward (0= task only).maxDelegations(int maxDelegations) Sets the maximum delegations per parent invocation (0= unlimited).toolPrefix(String toolPrefix) Sets the tool-name prefix (default"delegate_to").
-
Method Details
-
agents
Sets the sub-agent names (required, at least one).- Parameters:
agents- the sub-agent names- Returns:
- this builder
-
agents
Sets the sub-agent names (required, at least one).- Parameters:
agents- the sub-agent names- Returns:
- this builder
-
agentRefs
Adds sub-agents fromAgentRefs (usesAgentRef.getName()).- Parameters:
refs- the agent refs- Returns:
- this builder
-
toolPrefix
Sets the tool-name prefix (default"delegate_to"). An empty string uses the bare agent name.- Parameters:
toolPrefix- the tool prefix- Returns:
- this builder
-
maxDelegations
Sets the maximum delegations per parent invocation (0= unlimited).- Parameters:
maxDelegations- the max delegations- Returns:
- this builder
-
historyLength
Sets the trailing parent-history length to forward (0= task only).- Parameters:
historyLength- the history length- Returns:
- this builder
-
artifactStrategy
Sets the artifact strategy (defaultArtifactStrategy.INLINE).- Parameters:
artifactStrategy- the artifact strategy- Returns:
- this builder
-
build
Builds theAgentsOptions.- Returns:
- a new
AgentsOptions - Throws:
IllegalArgumentException- if no agents are configured
-