Spaces:
Sleeping
Sleeping
Download app/agents/supervisor_agent.py from Prerna43/Shopify_AI: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/spaces/Prerna43/Shopify_AI/resolve/main/app/agents/supervisor_agent.py
- Command line
-
hf download hf://spaces/Prerna43/Shopify_AI/app/agents/supervisor_agent.py
-
curl -L -o supervisor_agent.py https://huggingface.co/spaces/Prerna43/Shopify_AI/resolve/main/app/agents/supervisor_agent.py
669 Bytes
| 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, | |
| } | |