From df6a630f35be20f5ca9fcdea796e7b8ba4f173a9 Mon Sep 17 00:00:00 2001 From: Nikhil-Doye Date: Sun, 19 Oct 2025 00:00:13 -0400 Subject: [PATCH] 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. --- src/services/agents/WorkflowAgent.ts | 3 +-- src/services/tools/ClassifyIntentTool.ts | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/services/agents/WorkflowAgent.ts b/src/services/agents/WorkflowAgent.ts index 59069eb..2b42b32 100644 --- a/src/services/agents/WorkflowAgent.ts +++ b/src/services/agents/WorkflowAgent.ts @@ -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; diff --git a/src/services/tools/ClassifyIntentTool.ts b/src/services/tools/ClassifyIntentTool.ts index dad77c1..12d248a 100644 --- a/src/services/tools/ClassifyIntentTool.ts +++ b/src/services/tools/ClassifyIntentTool.ts @@ -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")