java.lang.Object
com.agentforge4j.core.agent.AgentDefinition.Builder
- Enclosing class:
- AgentDefinition
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 Summary
Modifier and TypeMethodDescriptionbuild()Builds the validatedAgentDefinition.withAuthor(String author) Sets the author of the agent definition.withContact(String contact) Sets contact information for the agent author.withEnabled(boolean enabled) Sets whether the agent is enabled for use.Sets the unique agent identifier.withLocality(AgentLocality locality) Sets whether the agent runs locally or in the cloud.withModelTier(String modelTier) Sets the optional capability tier name (LITE/STANDARD/POWERFUL).Sets the human-readable agent name.withProviderPreferences(List<ProviderPreference> providerPreferences) Sets the ordered provider preferences for LLM execution.withSupportedCommands(List<String> supportedCommands) Sets the command types this agent can execute.withSystemPrompt(String systemPrompt) Sets the system prompt used by the agent.withVersion(String version) Sets the version of the agent definition.
-
Method Details
-
withId
Sets the unique agent identifier.- Parameters:
id- unique identifier for the agent- Returns:
- this builder
-
withName
Sets the human-readable agent name.- Parameters:
name- human-readable name of the agent- Returns:
- this builder
-
withLocality
Sets whether the agent runs locally or in the cloud.- Parameters:
locality- agent locality- Returns:
- this builder
-
withEnabled
Sets whether the agent is enabled for use.- Parameters:
enabled-truewhen the agent is enabled- Returns:
- this builder
-
withSystemPrompt
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
Sets the command types this agent can execute.- Parameters:
supportedCommands- list of supported commands;nulldefaults to an empty list- Returns:
- this builder
-
withAuthor
Sets the author of the agent definition.- Parameters:
author- the author- Returns:
- this builder
-
withContact
Sets contact information for the agent author.- Parameters:
contact- contact information- Returns:
- this builder
-
withVersion
Sets the version of the agent definition.- Parameters:
version- version string- Returns:
- this builder
-
withModelTier
Sets the optional capability tier name (LITE/STANDARD/POWERFUL).- Parameters:
modelTier- capability tier name, ornullfor none- Returns:
- this builder
-
build
Builds the validatedAgentDefinition.- Returns:
- immutable agent definition; never
null
-