chore: prompt
Browse files
app.py
CHANGED
|
@@ -29,33 +29,28 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
| 29 |
model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
|
| 30 |
|
| 31 |
system_prompt = """
|
| 32 |
-
You are a customer support officer.
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
4.Extract the transaction ID from the USER INPUT and continue to Step 5.
|
| 40 |
-
5.Verify that the extracted transaction ID appears exactly in the USER INPUT. If yes, continue to Step 6; if not, go to Step 7.
|
| 41 |
-
6.Mark the transaction ID as valid and set the flag found to true.
|
| 42 |
-
7.If no valid transaction ID is found, set the flag found to false.
|
| 43 |
-
|
| 44 |
-
To determine the transaction type:
|
| 45 |
-
|
| 46 |
-
1.If the transaction ID starts with 'payout', the type is payout.
|
| 47 |
-
2.If the transaction ID starts with 'payment', the type is payment.
|
| 48 |
|
| 49 |
===>USER INPUT BEGINS
|
| 50 |
{input}
|
| 51 |
<===USER INPUT ENDS
|
| 52 |
|
| 53 |
-
Respond in valid JSON with
|
| 54 |
-
|
| 55 |
found: (boolean) Whether a valid transaction ID was found.
|
| 56 |
transaction_id: (string, if found) The extracted transaction ID.
|
| 57 |
transaction_type: (string, if found) The transaction type in lowercase.
|
| 58 |
-
justification: (string)
|
| 59 |
Return only valid JSON and nothing else.
|
| 60 |
"""
|
| 61 |
|
|
|
|
| 29 |
model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
|
| 30 |
|
| 31 |
system_prompt = """
|
| 32 |
+
You are a customer support officer. Extract the transaction ID from the USER INPUT and determine its type.
|
| 33 |
|
| 34 |
+
Extraction rules:
|
| 35 |
+
- Look for words starting with 'payout' or 'payment'.
|
| 36 |
+
- The next character must be a dash ('-').
|
| 37 |
+
- There must be at least one digit or character after the dash.
|
| 38 |
+
- The transaction ID must appear exactly in the USER INPUT.
|
| 39 |
+
- If found, set found to true; otherwise, set found to false.
|
| 40 |
|
| 41 |
+
Type rules:
|
| 42 |
+
- If the transaction ID starts with 'payout', type is payout.
|
| 43 |
+
- If it starts with 'payment', type is payment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
===>USER INPUT BEGINS
|
| 46 |
{input}
|
| 47 |
<===USER INPUT ENDS
|
| 48 |
|
| 49 |
+
Respond in valid JSON with these fields:
|
|
|
|
| 50 |
found: (boolean) Whether a valid transaction ID was found.
|
| 51 |
transaction_id: (string, if found) The extracted transaction ID.
|
| 52 |
transaction_type: (string, if found) The transaction type in lowercase.
|
| 53 |
+
justification: (string) Explain how you determined the transaction ID and type. If not found, do not fabricate an explanation.
|
| 54 |
Return only valid JSON and nothing else.
|
| 55 |
"""
|
| 56 |
|