Class AgentsOptions
java.lang.Object
com.google.genkit.plugins.middleware.AgentsOptions
Options controlling the sub-agent delegation tools produced by
Agents.
The only required field is getAgents() (at least one sub-agent). The remaining fields
have the following defaults:
toolPrefix—"delegate_to"; an empty string means the bare agent name is used as the tool name.maxDelegations—0(unlimited).historyLength—0(task only; seeAgentsfor exactly how a non-zero value is forwarded to client-managed vs. server-managed sub-agents).artifactStrategy—ArtifactStrategy.INLINE.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentsOptions.Builderbuilder()Creates a builder forAgentsOptions.Returns the configured sub-agent names.Returns the artifact strategy.intReturns the number of trailing prior messages (from this sub-agent's own accumulated conversation with the delegating parent session, not the parent's own history) to forward on each delegation call.intReturns the maximum number of delegations per parent generate invocation.Returns the tool-name prefix.
-
Method Details
-
builder
Creates a builder forAgentsOptions.- Returns:
- a new builder
-
getAgents
Returns the configured sub-agent names.- Returns:
- the sub-agent names (never empty)
-
getToolPrefix
Returns the tool-name prefix. An empty string means the bare agent name is the tool name.- Returns:
- the tool prefix
-
getMaxDelegations
public int getMaxDelegations()Returns the maximum number of delegations per parent generate invocation.0means unlimited.- Returns:
- the max delegations
-
getHistoryLength
public int getHistoryLength()Returns the number of trailing prior messages (from this sub-agent's own accumulated conversation with the delegating parent session, not the parent's own history) to forward on each delegation call.0means task only, no history forwarded.See
Agentsfor exactly how this is applied for client-managed vs. server-managed sub-agents.- Returns:
- the history length
-
getArtifactStrategy
Returns the artifact strategy.- Returns:
- the artifact strategy
-