Luigi commited on
Commit
39c1d5c
·
1 Parent(s): fa7088b

secure get_tts_message func

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -117,10 +117,12 @@ def get_tts_message(intent_result):
117
  Determine the TTS message based on the classification result.
118
  Reservation intent returns one message; all others, another.
119
  """
120
- if "訂位意圖" in intent_result and "無" not in intent_result:
121
  return "稍後您將會從簡訊收到訂位連結"
122
- else:
123
  return "我們將會將您的回饋傳達給負責人,謝謝您"
 
 
124
 
125
  def play_tts_message(message, voice='af_heart'):
126
  """
 
117
  Determine the TTS message based on the classification result.
118
  Reservation intent returns one message; all others, another.
119
  """
120
+ if intent_result and "訂位意圖" in intent_result and "無" not in intent_result:
121
  return "稍後您將會從簡訊收到訂位連結"
122
+ elif intent_result:
123
  return "我們將會將您的回饋傳達給負責人,謝謝您"
124
+ else:
125
+ return "未能判斷意圖"
126
 
127
  def play_tts_message(message, voice='af_heart'):
128
  """