Chandima Prabhath commited on
Commit
dc0ed92
·
1 Parent(s): da0b02a

Remove redundant acceptance message in voice reply function and log failure instead

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -301,7 +301,6 @@ def _fn_voice_reply(
301
  res = generate_voice_reply(proc, model="openai-audio", voice="coral", audio_dir=BotConfig.AUDIO_DIR)
302
  except Exception as e:
303
  logger.warning(f"Audio generation failed ({e}); sending text only.")
304
- _fn_send_accept(message_id, chat_id, prompt)
305
  return
306
 
307
  if res and res[0]:
@@ -309,7 +308,7 @@ def _fn_voice_reply(
309
  client.send_media(message_id, chat_id, path, "", media_type="audio")
310
  os.remove(path)
311
  else:
312
- _fn_send_accept(message_id, chat_id, prompt)
313
 
314
  # --- Pydantic Models for Function Calling --------------------------------
315
 
 
301
  res = generate_voice_reply(proc, model="openai-audio", voice="coral", audio_dir=BotConfig.AUDIO_DIR)
302
  except Exception as e:
303
  logger.warning(f"Audio generation failed ({e}); sending text only.")
 
304
  return
305
 
306
  if res and res[0]:
 
308
  client.send_media(message_id, chat_id, path, "", media_type="audio")
309
  os.remove(path)
310
  else:
311
+ logger.warning("Audio reply failed")
312
 
313
  # --- Pydantic Models for Function Calling --------------------------------
314