Class AgentsOptions

java.lang.Object
com.google.genkit.plugins.middleware.AgentsOptions

public final class AgentsOptions extends Object
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.
  • maxDelegations0 (unlimited).
  • historyLength0 (task only; see Agents for exactly how a non-zero value is forwarded to client-managed vs. server-managed sub-agents).
  • artifactStrategyArtifactStrategy.INLINE.
  • Method Details

    • builder

      public static AgentsOptions.Builder builder()
      Creates a builder for AgentsOptions.
      Returns:
      a new builder
    • getAgents

      public List<String> getAgents()
      Returns the configured sub-agent names.
      Returns:
      the sub-agent names (never empty)
    • getToolPrefix

      public String 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. 0 means 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. 0 means task only, no history forwarded.

      See Agents for exactly how this is applied for client-managed vs. server-managed sub-agents.

      Returns:
      the history length
    • getArtifactStrategy

      public ArtifactStrategy getArtifactStrategy()
      Returns the artifact strategy.
      Returns:
      the artifact strategy