Package com.tnsai.enums
Enum Class AgentVariant
- All Implemented Interfaces:
Serializable,Comparable<AgentVariant>,Constable
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");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumToken cost level.static enumQuality level.static enumExecution speed.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentVariantSuggests a variant based on task description keywords.getCost()getSpeed()booleanReturns true if this variant prioritizes cost savings.booleanReturns true if this variant prioritizes quality over speed.booleanReturns true if this variant prioritizes speed over quality.static AgentVariantReturns the enum constant of this class with the specified name.static AgentVariant[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
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
Balanced quality variant. Uses capable models (GPT-4o, Claude Sonnet), standard tools, balanced context. Best for: Regular development, feature implementation, debugging. -
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
Automatic variant selection. Analyzes task complexity and selects the appropriate variant dynamically. Best for: Production environments with varied workloads.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getQuality
-
getSpeed
-
getCost
-
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
Suggests a variant based on task description keywords.- Parameters:
taskDescription- the task description- Returns:
- suggested variant
-