Download agents/planner.py from MBG0903/Procelevate_Agentic_Warehouse_Operator_v2: direct link, hf CLI and curl.
- Browser
- Download file 3.74 kB
-
https://huggingface.co/spaces/MBG0903/Procelevate_Agentic_Warehouse_Operator_v2/resolve/main/agents/planner.py
- Command line
-
hf download hf://spaces/MBG0903/Procelevate_Agentic_Warehouse_Operator_v2/agents/planner.py
-
curl -L -o planner.py https://huggingface.co/spaces/MBG0903/Procelevate_Agentic_Warehouse_Operator_v2/resolve/main/agents/planner.py
3.74 kB
| def detect_intent(message: str): | |
| """ | |
| A robust, rule-based classifier for warehouse AI tasks. | |
| Returns one of: | |
| - "slotting" | |
| - "picking" | |
| - "forecast" | |
| - "replenishment" | |
| - "rebalancing" | |
| - "workforce" | |
| - "dock" | |
| - "report" | |
| """ | |
| msg = message.lower().strip() | |
| # ----------------------------- | |
| # FULL REPORT KEYWORDS (Highest Priority) | |
| # ----------------------------- | |
| report_keywords = [ | |
| "full report", "overall performance", "warehouse report", | |
| "summary", "end to end", "combined", "complete report", | |
| "all optimizations", "generate full report" | |
| ] | |
| # ----------------------------- | |
| # DEMAND FORECASTING KEYWORDS | |
| # ----------------------------- | |
| forecast_keywords = [ | |
| "forecast", "predict", "demand", "future usage", | |
| "consumption trend", "estimate usage", "project demand", | |
| "usage forecast" | |
| ] | |
| # ----------------------------- | |
| # REPLENISHMENT KEYWORDS | |
| # ----------------------------- | |
| replenish_keywords = [ | |
| "replenish", "refill", "stock level", "stock levels", | |
| "stockout", "stock-out", "low stock", "running low", | |
| "replenishment", "min max", "restock", "safety stock" | |
| ] | |
| # ----------------------------- | |
| # INVENTORY REBALANCING KEYWORDS | |
| # ----------------------------- | |
| rebalancing_keywords = [ | |
| "rebalance", "redistribute", "inventory balancing", | |
| "zone balancing", "congestion", "reduce aisle load", | |
| "balance inventory", "redistribution" | |
| ] | |
| # ----------------------------- | |
| # WORKFORCE OPTIMIZATION KEYWORDS | |
| # ----------------------------- | |
| workforce_keywords = [ | |
| "workforce", "staff", "labour", "labor", "manpower", | |
| "how many workers", "allocate workers", "workload", | |
| "staffing requirement", "optimize workforce" | |
| ] | |
| # ----------------------------- | |
| # DOCK SCHEDULING KEYWORDS | |
| # ----------------------------- | |
| dock_keywords = [ | |
| "dock", "dock scheduling", "loading bay", "unloading", | |
| "assign dock", "dock allocation", "door scheduling", | |
| "truck scheduling" | |
| ] | |
| # ----------------------------- | |
| # 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" | |
| ] | |
| # ----------------------------- | |
| # PRIORITY ORDER: | |
| # 1. Full report | |
| # 2. Forecast | |
| # 3. Replenishment | |
| # 4. Rebalancing | |
| # 5. Workforce | |
| # 6. Dock Scheduling | |
| # 7. Slotting | |
| # 8. Picking | |
| # ----------------------------- | |
| if any(k in msg for k in report_keywords): | |
| return "report" | |
| if any(k in msg for k in forecast_keywords): | |
| return "forecast" | |
| if any(k in msg for k in replenish_keywords): | |
| return "replenishment" | |
| if any(k in msg for k in rebalancing_keywords): | |
| return "rebalancing" | |
| if any(k in msg for k in workforce_keywords): | |
| return "workforce" | |
| if any(k in msg for k in dock_keywords): | |
| return "dock" | |
| 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" | |