chatgpt-on-wechat
chatgpt-on-wechat copied to clipboard
默认OpenAI的 语音识别报错
trafficstars
环境: Docker 部署,openai官方api链接 docker中 python: 3.10.13 使用场景:个人微信
docker-compose.yml配置如下
services:
chatgpt-on-wechat:
image: zhayujie/chatgpt-on-wechat
container_name: chatgpt-on-wechat
security_opt:
- seccomp:unconfined
environment:
OPEN_AI_API_KEY: 'sk-xxxx'
MODEL: 'gpt-3.5-turbo'
PROXY: ''
SINGLE_CHAT_PREFIX: '[""]'
SINGLE_CHAT_REPLY_PREFIX: '""'
GROUP_CHAT_PREFIX: '["@bot"]'
GROUP_NAME_WHITE_LIST: '[""]'
IMAGE_CREATE_PREFIX: '["画", "看", "找"]'
CONVERSATION_MAX_TOKENS: 1000
SPEECH_RECOGNITION: 'True'
CHARACTER_DESC: '你是公司客服, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流>。'
EXPIRES_IN_SECONDS: 3600
USE_GLOBAL_PLUGIN_CONFIG: 'True'
USE_LINKAI: 'False'
LINKAI_API_KEY: ''
LINKAI_APP_CODE: ''
VOICE_TO_TEXT: "openai"
TEXT_TO_VOICE: "openai"
VOICE_REPLY_VOICE: "true"
VOICE_TO_TEXT: "true"
TEXT_TO_VOICE_MODEL: "tts-1"
TTS_VOICE_ID: "alloy"
CHANNEL_TYPE: "wx"
现象:文字可以正常回复,语音后台打印直接报错
[INFO][2023-12-21 07:43:59][bridge.py:49] - create bot chatGPT for chat
[INFO][2023-12-21 07:43:59][chat_gpt_bot.py:49] - [CHATGPT] query=你好
[INFO][2023-12-21 07:44:04][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=你好!有什么问题我可以帮助你解决吗?), receiver=@2c5b07608af3fe0ce096b263082071cf
[INFO][2023-12-21 07:44:26][bridge.py:49] - create bot True for voice_to_text
[ERROR][2023-12-21 07:44:26][chat_channel.py:299] - Worker return exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/app/channel/chat_channel.py", line 168, in _handle
reply = self._generate_reply(context)
File "/app/channel/chat_channel.py", line 201, in _generate_reply
reply = super().build_voice_to_text(wav_path)
File "/app/channel/channel.py", line 40, in build_voice_to_text
return Bridge().fetch_voice_to_text(voice_file)
File "/app/bridge/bridge.py", line 67, in fetch_voice_to_text
return self.get_bot("voice_to_text").voiceToText(voiceFile)
File "/app/bridge/bridge.py", line 53, in get_bot
self.bots[typename] = create_voice(self.btype[typename])
File "/app/voice/factory.py", line 45, in create_voice
raise RuntimeError
RuntimeError
没人能完全解决这个问题,只能靠作者。。。
最新版本已修复,可更新代码