Download agents/planner.py from MBG0903/Procelevate_Agentic_Warehouse_Operator: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/spaces/MBG0903/Procelevate_Agentic_Warehouse_Operator/resolve/main/agents/planner.py
- Command line
-
hf download hf://spaces/MBG0903/Procelevate_Agentic_Warehouse_Operator/agents/planner.py
-
curl -L -o planner.py https://huggingface.co/spaces/MBG0903/Procelevate_Agentic_Warehouse_Operator/resolve/main/agents/planner.py
1.58 kB
| def detect_intent(message: str): | |
| """ | |
| A robust, rule-based classifier for warehouse tasks. | |
| Returns one of: | |
| - "slotting" | |
| - "picking" | |
| - "report" | |
| """ | |
| msg = message.lower().strip() | |
| # ----------------------------- | |
| # SLOTING KEYWORDS | |
| # ----------------------------- | |
| slot_keywords = [ | |
| "slot", "slotting", "putaway", "storage location", | |
| "rearrange items", "reorganize racks", "optimize space", | |
| "velocity", "sku placement", "bin allocation" | |
| ] | |
| # ----------------------------- | |
| # PICKING KEYWORDS | |
| # ----------------------------- | |
| pick_keywords = [ | |
| "pick", "picking", "route", "path", "walk sequence", | |
| "shortest path", "aisle", "rack", "order fulfillment", | |
| "picklist" | |
| ] | |
| # ----------------------------- | |
| # FULL REPORT KEYWORDS | |
| # ----------------------------- | |
| report_keywords = [ | |
| "full report", "overall performance", "warehouse report", | |
| "summary", "end to end", "combined", "complete report", | |
| "all optimizations" | |
| ] | |
| # ----------------------------- | |
| # PRIORITY: Full Report → Slotting → Picking | |
| # (Prevents overlap confusion) | |
| # ----------------------------- | |
| if any(k in msg for k in report_keywords): | |
| return "report" | |
| if any(k in msg for k in slot_keywords): | |
| return "slotting" | |
| if any(k in msg for k in pick_keywords): | |
| return "picking" | |
| # ----------------------------- | |
| # UNKNOWN → DEFAULT TO REPORT | |
| # ----------------------------- | |
| return "report" | |