Package com.tnsai.agents.variant
Class TaskComplexityAnalyzer
java.lang.Object
com.tnsai.agents.variant.TaskComplexityAnalyzer
Analyzes task complexity to determine the appropriate agent variant.
Scoring factors:
- Input Length: Token count estimation
- Required Tools: Number and complexity of tools needed
- Domain Specificity: Technical domain detection
- Task Type: Analysis, generation, transformation, etc.
Complexity Levels
| Score | Level | Suggested Variant |
|---|---|---|
| 0.0-0.3 | Simple | MINI |
| 0.3-0.7 | Medium | MEDIUM |
| 0.7-1.0 | Complex | HIGH |
- Author:
- TnsAI Team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumComplexity levels.static final recordComplexity analysis result. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAnalyzes task complexity and returns a score between 0.0 and 1.0.Suggests a variant based on complexity score.
-
Constructor Details
-
TaskComplexityAnalyzer
public TaskComplexityAnalyzer()
-
-
Method Details
-
analyze
Analyzes task complexity and returns a score between 0.0 and 1.0.- Parameters:
taskDescription- the task description to analyze- Returns:
- complexity score (0.0 = simple, 1.0 = complex)
-
suggestVariant
Suggests a variant based on complexity score.- Parameters:
result- the complexity result- Returns:
- suggested agent variant
-