Spaces:
Sleeping
Sleeping
File size: 669 Bytes
80ef840 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | class SupervisorAgent:
def plan(self, message: str, order_id: str | None = None) -> dict:
lowered = message.lower()
needs_order = bool(order_id) or any(word in lowered for word in ["order", "shipment", "tracking", "delivery"])
needs_policy = any(
word in lowered
for word in ["refund", "return", "shipping", "payment", "cancel", "exchange", "warranty", "gift"]
)
return {
"run_intent_agent": True,
"run_order_agent": needs_order,
"run_policy_agent": needs_policy or True,
"run_reasoning_agent": True,
"run_validation_agent": True,
}
|