Record Class AgentDefinition

java.lang.Object
java.lang.Record
com.agentforge4j.core.agent.AgentDefinition

public record AgentDefinition(String id, String name, AgentLocality locality, boolean enabled, String systemPrompt, List<ProviderPreference> providerPreferences, List<String> supportedCommands, String author, String contact, String version, String modelTier) extends Record
Represents the definition of an agent, including its configuration and capabilities. Instances are immutable and validated at construction time.
  • Constructor Details

    • AgentDefinition

      public AgentDefinition(String id, String name, AgentLocality locality, boolean enabled, String systemPrompt, List<ProviderPreference> providerPreferences, List<String> supportedCommands, String author, String contact, String version, String modelTier)
      Creates an AgentDefinition with validation.
      Parameters:
      id - unique identifier for the agent
      name - human-readable name of the agent
      locality - whether the agent runs locally or in the cloud
      enabled - whether the agent is enabled for use
      systemPrompt - the system prompt used by the agent
      providerPreferences - ordered list of provider preferences for LLM execution
      supportedCommands - list of command types this agent can execute; null defaults to empty list
      author - the author of the agent definition
      contact - contact information for the agent author
      version - version of the agent definition
      modelTier - optional capability tier name (LITE/STANDARD/POWERFUL) resolved to a concrete model at invocation time; null when the agent relies on raw provider model pins or provider defaults. Stored as the tier name (a String) so core stays free of the llm-api enum; the name is validated where it is converted, at the runtime invocation boundary
  • Method Details

    • builder

      public static AgentDefinition.Builder builder()
      Returns a new AgentDefinition.Builder for assembling an AgentDefinition without positional arguments. Optional fields (supportedCommands, author, contact, modelTier) may be left unset; the required fields are validated when AgentDefinition.Builder.build() is called.
      Returns:
      new builder; never null
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • locality

      public AgentLocality locality()
      Returns the value of the locality record component.
      Returns:
      the value of the locality record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • systemPrompt

      public String systemPrompt()
      Returns the value of the systemPrompt record component.
      Returns:
      the value of the systemPrompt record component
    • providerPreferences

      public List<ProviderPreference> providerPreferences()
      Returns the value of the providerPreferences record component.
      Returns:
      the value of the providerPreferences record component
    • supportedCommands

      public List<String> supportedCommands()
      Returns the value of the supportedCommands record component.
      Returns:
      the value of the supportedCommands record component
    • author

      public String author()
      Returns the value of the author record component.
      Returns:
      the value of the author record component
    • contact

      public String contact()
      Returns the value of the contact record component.
      Returns:
      the value of the contact record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • modelTier

      public String modelTier()
      Returns the value of the modelTier record component.
      Returns:
      the value of the modelTier record component