Class AgentsOptions.Builder

java.lang.Object
com.google.genkit.plugins.middleware.AgentsOptions.Builder
Enclosing class:
AgentsOptions

public static final class AgentsOptions.Builder extends Object
Builder for AgentsOptions.
  • Method Details

    • agents

      public AgentsOptions.Builder agents(List<String> agents)
      Sets the sub-agent names (required, at least one).
      Parameters:
      agents - the sub-agent names
      Returns:
      this builder
    • agents

      public AgentsOptions.Builder agents(String... agents)
      Sets the sub-agent names (required, at least one).
      Parameters:
      agents - the sub-agent names
      Returns:
      this builder
    • agentRefs

      public AgentsOptions.Builder agentRefs(AgentRef... refs)
      Adds sub-agents from AgentRefs (uses AgentRef.getName()).
      Parameters:
      refs - the agent refs
      Returns:
      this builder
    • toolPrefix

      public AgentsOptions.Builder toolPrefix(String 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

      public AgentsOptions.Builder maxDelegations(int maxDelegations)
      Sets the maximum delegations per parent invocation (0 = unlimited).
      Parameters:
      maxDelegations - the max delegations
      Returns:
      this builder
    • historyLength

      public AgentsOptions.Builder historyLength(int historyLength)
      Sets the trailing parent-history length to forward (0 = task only).
      Parameters:
      historyLength - the history length
      Returns:
      this builder
    • artifactStrategy

      public AgentsOptions.Builder artifactStrategy(ArtifactStrategy artifactStrategy)
      Sets the artifact strategy (default ArtifactStrategy.INLINE).
      Parameters:
      artifactStrategy - the artifact strategy
      Returns:
      this builder
    • build

      public AgentsOptions build()
      Builds the AgentsOptions.
      Returns:
      a new AgentsOptions
      Throws:
      IllegalArgumentException - if no agents are configured