Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -158,7 +158,7 @@ def get_latest_whatsapp_conversation_sid(client):
|
|
158 |
|
159 |
# ---------------- Load Orders ----------------
|
160 |
def load_orders():
|
161 |
-
orders_path = "docs/
|
162 |
try:
|
163 |
with open(orders_path, "r", encoding="utf-8") as f:
|
164 |
return json.load(f)
|
@@ -167,10 +167,10 @@ def load_orders():
|
|
167 |
return {}
|
168 |
|
169 |
def extract_order_id(text):
|
170 |
-
pattern = r"\
|
171 |
match = re.search(pattern, text, re.IGNORECASE)
|
172 |
if match:
|
173 |
-
return match.group(
|
174 |
return None
|
175 |
|
176 |
def format_order_response(order_id, order_data):
|
|
|
158 |
|
159 |
# ---------------- Load Orders ----------------
|
160 |
def load_orders():
|
161 |
+
orders_path = "docs/CustomersOrder.json"
|
162 |
try:
|
163 |
with open(orders_path, "r", encoding="utf-8") as f:
|
164 |
return json.load(f)
|
|
|
167 |
return {}
|
168 |
|
169 |
def extract_order_id(text):
|
170 |
+
pattern = r"(order_id\s+\d+)"
|
171 |
match = re.search(pattern, text, re.IGNORECASE)
|
172 |
if match:
|
173 |
+
return match.group(1).lower()
|
174 |
return None
|
175 |
|
176 |
def format_order_response(order_id, order_data):
|