Create agents/planner.py
Browse files- agents/planner.py +41 -0
agents/planner.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ---------------------------------------------------------
|
| 2 |
+
# INTENT DETECTOR FOR AUTO-GPT WAREHOUSE AGENT
|
| 3 |
+
# ---------------------------------------------------------
|
| 4 |
+
|
| 5 |
+
def detect_intent(message: str) -> str:
|
| 6 |
+
"""
|
| 7 |
+
Classifies user intent for warehouse tasks.
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
if not message:
|
| 11 |
+
return "unknown"
|
| 12 |
+
|
| 13 |
+
msg = message.lower()
|
| 14 |
+
|
| 15 |
+
# Slotting-related
|
| 16 |
+
slotting_keywords = [
|
| 17 |
+
"slot", "slotting", "sku placement", "velocity",
|
| 18 |
+
"fast mover", "medium mover", "slow mover",
|
| 19 |
+
"optimize slotting", "re-slot"
|
| 20 |
+
]
|
| 21 |
+
if any(k in msg for k in slotting_keywords):
|
| 22 |
+
return "slotting_analysis"
|
| 23 |
+
|
| 24 |
+
# Picking path related
|
| 25 |
+
picking_keywords = [
|
| 26 |
+
"pick", "picking", "pick path", "route",
|
| 27 |
+
"picking route", "walking path", "optimize picking"
|
| 28 |
+
]
|
| 29 |
+
if any(k in msg for k in picking_keywords):
|
| 30 |
+
return "picking_route"
|
| 31 |
+
|
| 32 |
+
# Full assessment
|
| 33 |
+
overall_keywords = [
|
| 34 |
+
"full report", "warehouse report", "assessment",
|
| 35 |
+
"complete analysis", "operations report",
|
| 36 |
+
"full warehouse", "360"
|
| 37 |
+
]
|
| 38 |
+
if any(k in msg for k in overall_keywords):
|
| 39 |
+
return "full_warehouse_assessment"
|
| 40 |
+
|
| 41 |
+
return "unknown"
|