Chandima Prabhath commited on
Commit
97cefd5
·
1 Parent(s): 8f336a6

Enhance whatsapp_webhook to include voice prompt handling for audio replies.

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -231,6 +231,8 @@ async def whatsapp_webhook(request: Request):
231
  )
232
  reply = generate_llm(prompt)
233
  client.send_message(mid, chat_id, reply)
 
 
234
  return {"success": True}
235
 
236
  # --- Extract normal text + skip mentions ---
 
231
  )
232
  reply = generate_llm(prompt)
233
  client.send_message(mid, chat_id, reply)
234
+ voice_prompt = f"Speak only this dialog: {reply}"
235
+ task_queue.put({"type":"audio","message_id":mid,"chat_id":chat_id,"prompt":voice_prompt})
236
  return {"success": True}
237
 
238
  # --- Extract normal text + skip mentions ---