Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,7 @@ def generate_answer_with_groq(question, context):
|
|
110 |
payload = {
|
111 |
"model": "llama3-8b-8192",
|
112 |
"messages": [
|
113 |
-
{"role": "system", "content": "You are ToyBot, a friendly WhatsApp assistant
|
114 |
{"role": "user", "content": prompt},
|
115 |
],
|
116 |
"temperature": 0.5,
|
@@ -167,11 +167,10 @@ def load_orders():
|
|
167 |
return {}
|
168 |
|
169 |
def extract_order_id(text):
|
170 |
-
|
171 |
-
pattern = r"order_id\s+(\d+)"
|
172 |
match = re.search(pattern, text, re.IGNORECASE)
|
173 |
if match:
|
174 |
-
return match.group(
|
175 |
return None
|
176 |
|
177 |
def format_order_response(order_id, order_data):
|
|
|
110 |
payload = {
|
111 |
"model": "llama3-8b-8192",
|
112 |
"messages": [
|
113 |
+
{"role": "system", "content": "You are ToyBot, a friendly WhatsApp assistant..."},
|
114 |
{"role": "user", "content": prompt},
|
115 |
],
|
116 |
"temperature": 0.5,
|
|
|
167 |
return {}
|
168 |
|
169 |
def extract_order_id(text):
|
170 |
+
pattern = r"\bORD\d{3,}\b"
|
|
|
171 |
match = re.search(pattern, text, re.IGNORECASE)
|
172 |
if match:
|
173 |
+
return match.group(0).upper()
|
174 |
return None
|
175 |
|
176 |
def format_order_response(order_id, order_data):
|