Class AgentDefinition.Builder

java.lang.Object
com.agentforge4j.core.agent.AgentDefinition.Builder
Enclosing class:
AgentDefinition

public static final class AgentDefinition.Builder extends Object
Fluent builder for AgentDefinition. Lets callers omit the optional modelTier (and other optional fields) without passing a trailing null to the canonical constructor. Validation is deferred to build(), which delegates to the canonical constructor.
  • Method Details

    • withId

      public AgentDefinition.Builder withId(String id)
      Sets the unique agent identifier.
      Parameters:
      id - unique identifier for the agent
      Returns:
      this builder
    • withName

      public AgentDefinition.Builder withName(String name)
      Sets the human-readable agent name.
      Parameters:
      name - human-readable name of the agent
      Returns:
      this builder
    • withLocality

      public AgentDefinition.Builder withLocality(AgentLocality locality)
      Sets whether the agent runs locally or in the cloud.
      Parameters:
      locality - agent locality
      Returns:
      this builder
    • withEnabled

      public AgentDefinition.Builder withEnabled(boolean enabled)
      Sets whether the agent is enabled for use.
      Parameters:
      enabled - true when the agent is enabled
      Returns:
      this builder
    • withSystemPrompt

      public AgentDefinition.Builder withSystemPrompt(String systemPrompt)
      Sets the system prompt used by the agent.
      Parameters:
      systemPrompt - the system prompt
      Returns:
      this builder
    • withProviderPreferences

      public AgentDefinition.Builder withProviderPreferences(List<ProviderPreference> providerPreferences)
      Sets the ordered provider preferences for LLM execution.
      Parameters:
      providerPreferences - ordered list of provider preferences
      Returns:
      this builder
    • withSupportedCommands

      public AgentDefinition.Builder withSupportedCommands(List<String> supportedCommands)
      Sets the command types this agent can execute.
      Parameters:
      supportedCommands - list of supported commands; null defaults to an empty list
      Returns:
      this builder
    • withAuthor

      public AgentDefinition.Builder withAuthor(String author)
      Sets the author of the agent definition.
      Parameters:
      author - the author
      Returns:
      this builder
    • withContact

      public AgentDefinition.Builder withContact(String contact)
      Sets contact information for the agent author.
      Parameters:
      contact - contact information
      Returns:
      this builder
    • withVersion

      public AgentDefinition.Builder withVersion(String version)
      Sets the version of the agent definition.
      Parameters:
      version - version string
      Returns:
      this builder
    • withModelTier

      public AgentDefinition.Builder withModelTier(String modelTier)
      Sets the optional capability tier name (LITE/STANDARD/POWERFUL).
      Parameters:
      modelTier - capability tier name, or null for none
      Returns:
      this builder
    • build

      public AgentDefinition build()
      Builds the validated AgentDefinition.
      Returns:
      immutable agent definition; never null