Spaces:
Sleeping
Sleeping
update instruction
Browse files
app.py
CHANGED
|
@@ -7,10 +7,22 @@ import os
|
|
| 7 |
from typing import Dict, Any
|
| 8 |
|
| 9 |
# System prompt (must match training)
|
| 10 |
-
SYSTEM_PROMPT = """Determine if the message is a restaurant reservation.
|
| 11 |
-
If yes, extract
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
# Global variables for model caching
|
|
|
|
| 7 |
from typing import Dict, Any
|
| 8 |
|
| 9 |
# System prompt (must match training)
|
| 10 |
+
SYSTEM_PROMPT = """Determine if the message is a restaurant reservation request.
|
| 11 |
+
If yes, extract the following three fields as strings:
|
| 12 |
+
- "num_people": number of people (as a string, e.g., "4"). If not mentioned, use an empty string ("").
|
| 13 |
+
- "reservation_date": the exact date/time phrase from the message (as a string, do not convert or interpret; e.g., keep "明天晚上7點" as is). If not mentioned, use an empty string ("").
|
| 14 |
+
- "phone_num": the phone number (as a string, digits only, remove any hyphens or formatting; e.g., "0912345678"). If not mentioned, use an empty string ("").
|
| 15 |
+
|
| 16 |
+
If the message is NOT a reservation request, return:
|
| 17 |
+
```json
|
| 18 |
+
{
|
| 19 |
+
"num_people": "",
|
| 20 |
+
"reservation_date": "",
|
| 21 |
+
"phone_num": ""
|
| 22 |
+
}
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Output must be valid JSON only, with exactly these three fields and no additional text, fields, or explanations.
|
| 26 |
"""
|
| 27 |
|
| 28 |
# Global variables for model caching
|