No direct answer on voice message
Marcello87 opened this issue ยท 5 comments
Hi @Marcello87, that's interesting. I originally intended it as a way to only transcribe audio messages, and not as a direct voice command to ChatGPT.
Should be as easy as replacing these lines:
chatgpt-telegram-bot/telegram_bot.py
Lines 125 to 131 in 946f6a4
With:
response = self.openai.get_chat_response(chat_id=chat_id, query=transcript)
await context.bot.send_message(
chat_id=chat_id,
reply_to_message_id=update.message.message_id,
text=response,
parse_mode=constants.ParseMode.MARKDOWN
)
But I'm not sure how to allow both modes. Will keep this issue open for now, in case someone wants to help
Tested, works great for me, many thanks for the quick response.
I think it's difficult to use both modes at the same time. Maybe we can set a parameter like VOICE_TO_CHAT
and let users select their prefer mode.
Thanks @Marcello87 @slippersheepig
Added VOICE_REPLY_WITH_TRANSCRIPT_ONLY
env parameter which defaults to true
When I set VOICE_REPLY_WITH_TRANSCRIPT_ONLY
to false
, can I let the bot transcribe my voice and output it first, then reply it? It's more user-friendly.