Enum Class AgentVariant

java.lang.Object
java.lang.Enum<AgentVariant>
com.tnsai.enums.AgentVariant
All Implemented Interfaces:
Serializable, Comparable<AgentVariant>, Constable

public enum AgentVariant extends Enum<AgentVariant>
Defines quality/speed/cost tiers for agent execution.

Agent variants allow trading off between response quality, execution speed, and token costs. This enables cost optimization for different use cases:

  • HIGH: Maximum quality for complex, critical tasks
  • MEDIUM: Balanced performance for regular development
  • MINI: Fast and cheap for simple tasks
  • AUTO: Automatic selection based on task complexity

Usage


 Agent agent = AgentBuilder.create()
     .withVariant(AgentVariant.MEDIUM)
     .llm(new OpenAIClient())
     .build();

 // Or switch at runtime
 agent.setVariant(AgentVariant.HIGH);
 agent.chat("Complex refactoring task");
 
  • Enum Constant Details

    • HIGH

      public static final AgentVariant HIGH
      Maximum quality variant. Uses most capable models (GPT-4, Claude Opus), all tools, maximum context. Best for: Complex UI generation, critical code review, architectural decisions.
    • MEDIUM

      public static final AgentVariant MEDIUM
      Balanced quality variant. Uses capable models (GPT-4o, Claude Sonnet), standard tools, balanced context. Best for: Regular development, feature implementation, debugging.
    • MINI

      public static final AgentVariant MINI
      Minimal quality variant. Uses efficient models (GPT-4o-mini, Claude Haiku), limited tools, minimal context. Best for: Quick fixes, typo corrections, simple queries.
    • AUTO

      public static final AgentVariant AUTO
      Automatic variant selection. Analyzes task complexity and selects the appropriate variant dynamically. Best for: Production environments with varied workloads.
  • Method Details

    • values

      public static AgentVariant[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AgentVariant valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getQuality

      public AgentVariant.Quality getQuality()
    • getSpeed

      public AgentVariant.Speed getSpeed()
    • getCost

      public AgentVariant.Cost getCost()
    • getDescription

      public String getDescription()
    • isQualityFocused

      public boolean isQualityFocused()
      Returns true if this variant prioritizes quality over speed.
    • isSpeedFocused

      public boolean isSpeedFocused()
      Returns true if this variant prioritizes speed over quality.
    • isCostOptimized

      public boolean isCostOptimized()
      Returns true if this variant prioritizes cost savings.
    • forTask

      public static AgentVariant forTask(String taskDescription)
      Suggests a variant based on task description keywords.
      Parameters:
      taskDescription - the task description
      Returns:
      suggested variant