mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-03-19 21:38:18 +08:00
fix(azure_voice.py): log error details instead of cancellation details
This commit is contained in:
@@ -64,7 +64,8 @@ class AzureVoice(Voice):
|
|||||||
logger.info("[Azure] voiceToText voice file name={} text={}".format(voice_file, result.text))
|
logger.info("[Azure] voiceToText voice file name={} text={}".format(voice_file, result.text))
|
||||||
reply = Reply(ReplyType.TEXT, result.text)
|
reply = Reply(ReplyType.TEXT, result.text)
|
||||||
else:
|
else:
|
||||||
logger.error("[Azure] voiceToText error, result={}, canceldetails={}".format(result, result.cancellation_details))
|
cancel_details = result.cancellation_details
|
||||||
|
logger.error("[Azure] voiceToText error, result={}, errordetails={}".format(result, cancel_details.error_details))
|
||||||
reply = Reply(ReplyType.ERROR, "抱歉,语音识别失败")
|
reply = Reply(ReplyType.ERROR, "抱歉,语音识别失败")
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ class AzureVoice(Voice):
|
|||||||
logger.info("[Azure] textToVoice text={} voice file name={}".format(text, fileName))
|
logger.info("[Azure] textToVoice text={} voice file name={}".format(text, fileName))
|
||||||
reply = Reply(ReplyType.VOICE, fileName)
|
reply = Reply(ReplyType.VOICE, fileName)
|
||||||
else:
|
else:
|
||||||
logger.error("[Azure] textToVoice error, result={}, canceldetails={}".format(result, result.cancellation_details))
|
cancel_details = result.cancellation_details
|
||||||
|
logger.error("[Azure] textToVoice error, result={}, errordetails={}".format(result, cancel_details.error_details))
|
||||||
reply = Reply(ReplyType.ERROR, "抱歉,语音合成失败")
|
reply = Reply(ReplyType.ERROR, "抱歉,语音合成失败")
|
||||||
return reply
|
return reply
|
||||||
|
|||||||
Reference in New Issue
Block a user