Class TaskComplexityAnalyzer

java.lang.Object
com.tnsai.agents.variant.TaskComplexityAnalyzer

public class TaskComplexityAnalyzer extends Object
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

ScoreLevelSuggested Variant
0.0-0.3SimpleMINI
0.3-0.7MediumMEDIUM
0.7-1.0ComplexHIGH
Author:
TnsAI Team
  • Constructor Details

    • TaskComplexityAnalyzer

      public TaskComplexityAnalyzer()
  • Method Details

    • analyze

      public TaskComplexityAnalyzer.ComplexityResult analyze(String taskDescription)
      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

      public AgentVariant suggestVariant(TaskComplexityAnalyzer.ComplexityResult result)
      Suggests a variant based on complexity score.
      Parameters:
      result - the complexity result
      Returns:
      suggested agent variant