Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,15 +27,14 @@ candidate_tasks = [
|
|
27 |
def generate_response(intent, human=True):
|
28 |
if human:
|
29 |
prompt = (
|
30 |
-
f"
|
31 |
-
"[Greeting]
|
32 |
-
"Use placeholder numbers and express one sentence per section."
|
33 |
)
|
34 |
else:
|
35 |
prompt = (
|
36 |
-
f"
|
37 |
)
|
38 |
-
return text_generator(prompt, max_new_tokens=80, do_sample=
|
39 |
|
40 |
urgent_emotions = {"anger", "frustration", "anxiety", "urgency", "afraid", "annoyed"}
|
41 |
moderate_emotions = {"confused", "sad", "tired", "concerned", "sadness"}
|
|
|
27 |
def generate_response(intent, human=True):
|
28 |
if human:
|
29 |
prompt = (
|
30 |
+
f"You are a telecom customer service agent. For the customer intent '{intent}', provide a helpful reply using this 3-part format: "
|
31 |
+
"[Greeting: short polite opener.] [Middle: Mention customer is currently using Plan X at ¥X/month (fictional), recommend Plan Y with XXGB at ¥Y/month (fictional).] [Ending: Ask if they want to proceed.]"
|
|
|
32 |
)
|
33 |
else:
|
34 |
prompt = (
|
35 |
+
f"You are a helpful telecom AI assistant. Answer the customer intent '{intent}' in a short, friendly, single sentence. Offer relevant support or recommendation directly, using fictional placeholders like Plan X, ¥X, 10GB etc."
|
36 |
)
|
37 |
+
return text_generator(prompt, max_new_tokens=80, do_sample=False)[0]['generated_text']
|
38 |
|
39 |
urgent_emotions = {"anger", "frustration", "anxiety", "urgency", "afraid", "annoyed"}
|
40 |
moderate_emotions = {"confused", "sad", "tired", "concerned", "sadness"}
|