Refactor workflow agent and routing components for improved functionality

- Introduce WorkflowAgentStage to manage agent stage configurations and enhance interaction with the workflow engine.
- Implement WorkflowEdgeEvaluator for priority-aware edge evaluation, improving routing decisions based on conditions and user turns.
- Update WorkflowBrain to handle user turns and routing more effectively, ensuring agents cannot have only one default path.
- Enhance CallEndCoordinator to track speech events and manage call termination based on queued speech.
- Add new models and output handling for workflow interactions, improving clarity and maintainability.
- Update tests to validate the new routing logic and agent behavior under various scenarios.
This commit is contained in:
Xin Wang
2026-07-17 22:37:15 +08:00
parent 162a3d8bec
commit bdf3d3dd9c
23 changed files with 1374 additions and 475 deletions

View File

@@ -177,6 +177,11 @@ class WorkflowEngine:
try:
if operator == "exists":
matched = exists if expected is not False else not exists
elif not exists:
# Missing values are never equal, unequal, greater or
# contained. Use the explicit ``exists`` operator when the
# distinction between missing and present is important.
matched = False
elif operator == "eq":
matched = actual == expected
elif operator == "neq":