Refactor WorkflowAgent and ClassifyIntentTool for improved clarity and performance

- Removed unused AgentTask import from WorkflowAgent to streamline code.
- Simplified complexity determination logic in ClassifyIntentTool by eliminating the complexityScore variable, enhancing readability and efficiency.
This commit is contained in:
Nikhil-Doye
2025-10-19 00:00:13 -04:00
parent dfd39069b5
commit df6a630f35
2 changed files with 1 additions and 4 deletions
+1 -2
View File
@@ -1,11 +1,10 @@
import {
AgentTask,
AgentResult,
AgentContext,
ToolExecutionPlan,
} from "../../types/tools";
import { toolRegistry } from "../tools/ToolRegistry";
import { ParsedIntent, WorkflowStructure, ValidationResult } from "../../types";
import { ParsedIntent } from "../../types";
export class WorkflowAgent {
private context: AgentContext;
-2
View File
@@ -200,14 +200,12 @@ Respond with JSON:
// Determine complexity level
let complexity = "SIMPLE";
let complexityScore = 0;
Object.entries(complexityIndicators).forEach(([type, keywords]) => {
const matches = keywords.filter((keyword) =>
input.includes(keyword)
).length;
if (matches > 0) {
complexityScore += matches;
if (type === "complex" && matches >= 2) complexity = "ENTERPRISE";
else if (type === "multiStep" && matches >= 2) complexity = "COMPLEX";
else if (matches >= 1 && complexity === "SIMPLE")