JoshuaZywoo commited on
Commit
ef8cc0f
·
verified ·
1 Parent(s): 8174974

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -30,13 +30,13 @@ candidate_tasks = [
30
  ]
31
 
32
  intent_solutions = {
33
- "top up balance": "Your balance is \u00a512. Promo: recharge \u00a5100 get \u00a55 bonus.",
34
- "reactivate service": "Service suspended due to unpaid \u00a538. Recharge to restore in 30 mins.",
35
- "change mobile plan": "You're on Basic (\u00a568/5GB). Suggest Plus (\u00a598/20GB).",
36
- "check account status": "Data: 3.2GB/5GB. Balance: \u00a512. Calls left: 22 mins.",
37
- "ask for billing support": "Last bill: \u00a596 (Mar). Includes \u00a516 overage.",
38
  "cancel subscription": "Contract ends: 2025-06-30. No penalty after this date.",
39
- "upgrade device": "Eligible for upgrade. New iPhone plan: \u00a5399/month.",
40
  "report service outage": "Signal issues detected (ZIP: XXX). Engineers notified."
41
  }
42
 
@@ -87,7 +87,7 @@ def get_emotion_score(emotion):
87
  # Streamlit UI Logic
88
  # ------------------------------
89
  st.set_page_config(page_title="Smart Customer Support Assistant", layout="centered")
90
- st.title("\ud83d\udcde Smart Customer Support Assistant (for Agents Only)")
91
 
92
  # Session state to store chat
93
  if 'chat' not in st.session_state:
@@ -143,7 +143,7 @@ with col2:
143
  # If human support needed
144
  if st.session_state.system_result:
145
  st.markdown("---")
146
- st.subheader("\ud83d\udc69\u200d\ud83d\udcbb Agent Response Panel")
147
 
148
  # Agent editable response
149
  st.session_state.agent_reply = st.text_area("Compose your reply:", value=st.session_state.agent_reply)
@@ -154,12 +154,12 @@ if st.session_state.system_result:
154
  st.session_state.system_result = None
155
 
156
  # Context info
157
- st.markdown("#### \ud83d\udc64 Customer Status")
158
  st.markdown(f"- **Emotion:** {st.session_state.system_result['emotion'].capitalize()}")
159
  st.markdown(f"- **Tone:** {st.session_state.system_result['tone']}")
160
 
161
  # Suggested replies
162
- st.markdown("#### \ud83e\uddf0 Detected Customer Needs")
163
  for intent in st.session_state.system_result['intents']:
164
  st.markdown(f"**• {intent.capitalize()}**")
165
  suggestion = f"Thank you for contacting us. I understand your concern. {intent_solutions[intent]} {intent_closings[intent]}"
 
30
  ]
31
 
32
  intent_solutions = {
33
+ "top up balance": "Your balance is ¥12. Promo: recharge ¥100 get ¥5 bonus.",
34
+ "reactivate service": "Service suspended due to unpaid ¥38. Recharge to restore in 30 mins.",
35
+ "change mobile plan": "You're on Basic (¥68/5GB). Suggest Plus (¥98/20GB).",
36
+ "check account status": "Data: 3.2GB/5GB. Balance: ¥12. Calls left: 22 mins.",
37
+ "ask for billing support": "Last bill: ¥96 (Mar). Includes ¥16 overage.",
38
  "cancel subscription": "Contract ends: 2025-06-30. No penalty after this date.",
39
+ "upgrade device": "Eligible for upgrade. New iPhone plan: ¥399/month.",
40
  "report service outage": "Signal issues detected (ZIP: XXX). Engineers notified."
41
  }
42
 
 
87
  # Streamlit UI Logic
88
  # ------------------------------
89
  st.set_page_config(page_title="Smart Customer Support Assistant", layout="centered")
90
+ st.title("Smart Customer Support Assistant (for Agents Only)")
91
 
92
  # Session state to store chat
93
  if 'chat' not in st.session_state:
 
143
  # If human support needed
144
  if st.session_state.system_result:
145
  st.markdown("---")
146
+ st.subheader("Agent Response Panel")
147
 
148
  # Agent editable response
149
  st.session_state.agent_reply = st.text_area("Compose your reply:", value=st.session_state.agent_reply)
 
154
  st.session_state.system_result = None
155
 
156
  # Context info
157
+ st.markdown("#### Customer Status")
158
  st.markdown(f"- **Emotion:** {st.session_state.system_result['emotion'].capitalize()}")
159
  st.markdown(f"- **Tone:** {st.session_state.system_result['tone']}")
160
 
161
  # Suggested replies
162
+ st.markdown("#### Detected Customer Needs")
163
  for intent in st.session_state.system_result['intents']:
164
  st.markdown(f"**• {intent.capitalize()}**")
165
  suggestion = f"Thank you for contacting us. I understand your concern. {intent_solutions[intent]} {intent_closings[intent]}"