JoshuaZywoo commited on
Commit
a2534fc
·
verified ·
1 Parent(s): 8333387

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -54,21 +54,16 @@ def get_emotion_score(emotion):
54
  return 0.2
55
 
56
  def generate_response(intent, human=True):
57
- if human:
58
- prompt = (
59
- f"You are a telecom customer service agent. For the customer intent '{intent}', generate a 3-sentence response:\n"
60
- "[Greeting: polite opener.]\n"
61
- "[Middle: State that current plan is Plan X, ¥X/month, and recommend Plan Y with XXGB at ¥Y/month. Use fictional values.]\n"
62
- "[End: Ask if they'd like to proceed. One sentence only.]"
63
- )
64
- else:
65
- prompt = (
66
- f"You are a helpful telecom assistant. Briefly resolve the intent '{intent}' in one sentence. "
67
- "Use placeholders like Plan X, ¥X/month, and keep the tone friendly."
68
- )
69
- result = text_generator(prompt, max_new_tokens=80, do_sample=False)
70
  return result[0]['generated_text'].strip()
71
 
 
72
  # Streamlit config
73
  st.set_page_config(page_title="Smart Customer Support Assistant", layout="wide")
74
  st.sidebar.title("📁 Customer Selector")
 
54
  return 0.2
55
 
56
  def generate_response(intent, human=True):
57
+ prompt = (
58
+ f"You are a telecom customer service assistant. For the customer intent '{intent}', generate a 3-part response:\n"
59
+ "[Greeting: polite welcome.]\n"
60
+ "[Middle: mention the customer is currently on Plan X (¥X/month), and suggest switching to Plan Y with XXGB at ¥Y/month. Use fictional placeholder values.]\n"
61
+ "[End: ask if they'd like to proceed with the new plan or need more details.]"
62
+ )
63
+ result = text_generator(prompt, max_new_tokens=100, do_sample=False)
 
 
 
 
 
 
64
  return result[0]['generated_text'].strip()
65
 
66
+
67
  # Streamlit config
68
  st.set_page_config(page_title="Smart Customer Support Assistant", layout="wide")
69
  st.sidebar.title("📁 Customer Selector")