mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-20 00:22:31 +00:00
fix: clear media_paths after successful voice transcription\
\ After transcribing a WhatsApp voice message, the .ogg file path \ remains in media_paths and gets appended as a [file: ...] tag. \ The LLM sees this tag and responds that it cannot process audio, \ even though the transcription already succeeded.
This commit is contained in:
parent
6a25d8042d
commit
45d999ae70
@ -265,6 +265,7 @@ class WhatsAppChannel(BaseChannel):
|
|||||||
transcription = await self.transcribe_audio(media_paths[0])
|
transcription = await self.transcribe_audio(media_paths[0])
|
||||||
if transcription:
|
if transcription:
|
||||||
content = transcription
|
content = transcription
|
||||||
|
media_paths = []
|
||||||
self.logger.info("Transcribed voice from {}: {}...", sender_id, transcription[:50])
|
self.logger.info("Transcribed voice from {}: {}...", sender_id, transcription[:50])
|
||||||
else:
|
else:
|
||||||
content = "[Voice Message: Transcription failed]"
|
content = "[Voice Message: Transcription failed]"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user