mirror of
https://github.com/Nikhil-Doye/workflow-builder.git
synced 2026-07-22 02:01:56 +02:00
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:
@@ -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;
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user