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.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAgentDefinition(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. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.static AgentDefinition.Builderbuilder()Returns a newAgentDefinition.Builderfor assembling anAgentDefinitionwithout positional arguments.contact()Returns the value of thecontactrecord component.booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.locality()Returns the value of thelocalityrecord component.Returns the value of themodelTierrecord component.name()Returns the value of thenamerecord component.Returns the value of theproviderPreferencesrecord component.Returns the value of thesupportedCommandsrecord component.Returns the value of thesystemPromptrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
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 agentname- human-readable name of the agentlocality- whether the agent runs locally or in the cloudenabled- whether the agent is enabled for usesystemPrompt- the system prompt used by the agentproviderPreferences- ordered list of provider preferences for LLM executionsupportedCommands- list of command types this agent can execute; null defaults to empty listauthor- the author of the agent definitioncontact- contact information for the agent authorversion- version of the agent definitionmodelTier- optional capability tier name (LITE/STANDARD/POWERFUL) resolved to a concrete model at invocation time;nullwhen the agent relies on raw provider model pins or provider defaults. Stored as the tier name (a String) socorestays free of thellm-apienum; the name is validated where it is converted, at the runtime invocation boundary
-
-
Method Details
-
builder
Returns a newAgentDefinition.Builderfor assembling anAgentDefinitionwithout positional arguments. Optional fields (supportedCommands,author,contact,modelTier) may be left unset; the required fields are validated whenAgentDefinition.Builder.build()is called.- Returns:
- new builder; never
null
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
locality
Returns the value of thelocalityrecord component.- Returns:
- the value of the
localityrecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
systemPrompt
Returns the value of thesystemPromptrecord component.- Returns:
- the value of the
systemPromptrecord component
-
providerPreferences
Returns the value of theproviderPreferencesrecord component.- Returns:
- the value of the
providerPreferencesrecord component
-
supportedCommands
Returns the value of thesupportedCommandsrecord component.- Returns:
- the value of the
supportedCommandsrecord component
-
author
Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-
contact
Returns the value of thecontactrecord component.- Returns:
- the value of the
contactrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
modelTier
Returns the value of themodelTierrecord component.- Returns:
- the value of the
modelTierrecord component
-