Closed FengNote closed 8 months ago
贴一下完整的 roles.json 配置
{ "1": { "model": "gpt-3.5-turbo", "start_text": "你好,我是,请问有什么我可以帮助你的吗?", "prompt": "你扮演一个孩子的小伙伴,名字叫小地瓜,用5岁孩子容易理解语言提供准确、有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心,现在她来到了你身边问了第一个问题:[你是谁]", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"voice_name": "zh-CN-XiaoxiaoNeural"
}
}, "2": { "model": "gpt-3.5-turbo", "start_text": "你好,俺是东北兔,请问有什么俺可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“东北兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"language": "zh-CN",
"voice_name": "zh-CN-XiaoxiaoNeural"
}
}, "3": { "model": "gpt-3.5-turbo", "start_text": "Hi, I'm Ana. Nice to meet you.", "prompt": "Your name is \"Ana\". Your task is to chat with me. Please respond in English, keeping your answers brief – no more than 50 words each time!", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "en-US", "service_region": "asiaeast", }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"language": "en-US",
"voice_name": "en-US-AnaNeural"
}
}, "4": { "model": "gpt-3.5-turbo", "start_text": "你好,请问有什么我可以帮助你的吗? ", "prompt": "你扮演一位智者,请用10岁孩子容易理解语言提供准确、形象的概念解释,每次回复根据聊天主题询问具体必要细节和我的想法,现在你来到了我身边问了第一个问题:[你好,那咱们来一起聊聊具体的情况吧]", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"language": "zh-CN",
"voice_name": "zh-CN-XiaoxiaoNeural"
}
}, "5": { "model": "gpt-3.5-turbo", "start_text": "你好,请问有什么我可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“东北兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"language": "zh-CN",
"voice_name": "zh-CN-XiaoyiNeural"
}
}, "6": { "model": "gpt-3.5-turbo", "start_text": "你好,请问有什么我可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“东北兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"language": "zh-CN",
"voice_name": "zh-TW-HsiaoChenNeural"
}
}, "7": { "model": "gpt-3.5-turbo", "start_text": "你好,请问有什么我可以帮助你的吗?", "prompt": "你是你是一个知识渊博,乐于助人的智能机器人,你的名字叫“东北兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
"tts_type": "azure-tts",
"tts_config": {
"service_region": "asiaeast",
"voice_name": "zh-CN-YunxiNeural"
}
} }
日志错误
2023-12-17 21:30:16,218 - DEBUG - Publish topic: /user/folotoy/a0a3b30ec998/thing/command/call, msg: {"msgId": 4, "identifier": "audioplay_cmd", "inputParams": {"recordingId": 3, "total": 0}} folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:52,167 - INFO - FoloToy Server Version: v23.50.1.4-beta folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:52,172 - ERROR - Run error: [Errno 111] Connection refused folotoy-server-self-hosting-folotoy-1 | Traceback (most recent call last): folotoy-server-self-hosting-folotoy-1 | File "core/folotoy_app.py", line 126, in core.folotoy_app.FolotoyApp.start folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 914, in connect folotoy-server-self-hosting-folotoy-1 | return self.reconnect() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1044, in reconnect folotoy-server-self-hosting-folotoy-1 | sock = self._create_socket_connection() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection folotoy-server-self-hosting-folotoy-1 | return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source) folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection folotoy-server-self-hosting-folotoy-1 | raise exceptions[0] folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection folotoy-server-self-hosting-folotoy-1 | sock.connect(sa) folotoy-server-self-hosting-folotoy-1 | ConnectionRefusedError: [Errno 111] Connection refused folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:52,176 - INFO - Sleep 2s to reconnect folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:54,176 - ERROR - Run error: [Errno 111] Connection refused folotoy-server-self-hosting-folotoy-1 | Traceback (most recent call last): folotoy-server-self-hosting-folotoy-1 | File "core/folotoy_app.py", line 126, in core.folotoy_app.FolotoyApp.start folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 914, in connect folotoy-server-self-hosting-folotoy-1 | return self.reconnect() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1044, in reconnect folotoy-server-self-hosting-folotoy-1 | sock = self._create_socket_connection() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection folotoy-server-self-hosting-folotoy-1 | return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source) folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection folotoy-server-self-hosting-folotoy-1 | raise exceptions[0] folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection folotoy-server-self-hosting-folotoy-1 | sock.connect(sa) folotoy-server-self-hosting-folotoy-1 | ConnectionRefusedError: [Errno 111] Connection refused folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:54,177 - INFO - Sleep 2s to reconnect folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:56,178 - ERROR - Run error: [Errno 111] Connection refused folotoy-server-self-hosting-folotoy-1 | Traceback (most recent call last): folotoy-server-self-hosting-folotoy-1 | File "core/folotoy_app.py", line 126, in core.folotoy_app.FolotoyApp.start folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 914, in connect folotoy-server-self-hosting-folotoy-1 | return self.reconnect() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1044, in reconnect folotoy-server-self-hosting-folotoy-1 | sock = self._create_socket_connection() folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection folotoy-server-self-hosting-folotoy-1 | return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source) folotoy-server-self-hosting-folotoy-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 851, in create_connection folotoy-server-self-hosting-folotoy-1 | raise exceptions[0] folotoy-server-self-hosting-folotoy-1 | File "/usr/local/lib/python3.11/socket.py", line 836, in create_connection folotoy-server-self-hosting-folotoy-1 | sock.connect(sa) folotoy-server-self-hosting-folotoy-1 | ConnectionRefusedError: [Errno 111] Connection refused folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:56,179 - INFO - Sleep 2s to reconnect folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:58,181 - INFO - Speech server started(0.0.0.0:8085/udp) folotoy-server-self-hosting-folotoy-1 | 2023-12-18 20:29:58,181 - INFO - Connected to MQTT Broker(emqx:1883)!
这个日志因为emqx启动太慢,最后连接成功了
还是没法对话, olotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,237 - DEBUG - Received token: 1fafd9a331ab440bbf3566bc752fef8a RecordingId: 2 folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,238 - DEBUG - Received frame type: b'\x01' folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,241 - DEBUG - Peer: ('114.249.61.177', 2393) Len: 20B folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,241 - DEBUG - Received token: 1fafd9a331ab440bbf3566bc752fef8a RecordingId: 2 folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,241 - DEBUG - Received frame type: b'\x02' folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,241 - DEBUG - Recording file created: /audio/recording-273d496dd61740bc8655ae86d79a3eb6.wav folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,242 - DEBUG - Current dkey=a0a3b30ec998 role=0 folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,242 - WARNING - Dkey a0a3b30ec998: role=0 config not found, please check your roles.json folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:54,242 - DEBUG - Publish topic: /user/folotoy/a0a3b30ec998/thing/command/call, msg: {"msgId": 3, "identifier": "audioplay_cmd", "inputParams": {"recordingId": 2, "total": 0}} folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:55,539 - DEBUG - Received /user/folotoy/a0a3b30ec998/thing/command/callAck: message data: {'msgId': 3, 'identifier': 'audioplay_cmd', 'result': 1} folotoy-server-self-hosting-folotoy-1 | 2023-12-18 22:04:55,539 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['a0a3b30ec998']} ^[[O^[[I^[[O^[[I^[[O^[[I
roles.json 添加一个为0的角色,或者任意按一下角色按键
固件之前有个role=0的debug,在一次都不按角色按钮直接对话情况下会触发,之前2个版本已经修复了
我已经试验了将one-api地址改成 https://one-api,magickchat.com/v1, 上这个网站注册的key, 还是不行 麻烦帮忙看看这个原因是什么呢?
version: '3' volumes: emqx-etc: emqx-data: emqx-log: services: emqx: image: emqx/emqx:latest restart: always ports:
./roles.json:/roles.json environment: TZ: Asia/Shanghai
LOG_LEVEL: DEBUG
ROLES_FILE_PATH: /roles.json
STT_TYPE: azure-stt
OPENAI_WHISPER_KEY: sk-aeTQiC6fFgddxxx2588e1e6615B22f OPENAI_WHISPER_MODEL: whisper-1
AZURE_WHISPER_API_BASE: https://xxxxx.openai.azure.com AZURE_WHISPER_KEY: 9afbef65bcf6487eeeeeeeeeeeeeeeeeee AZURE_WHISPER_DEPLOYMENT_NAME: whisper AZURE_WHISPER_API_VERSION: 2023-09-01-preview
AZURE_STT_KEY: 7800b422c213xxx1f22bb9ac9 AZURE_STT_SERVICE_REGION: eastasia
LLM_TYPE: openai
OPENAI_OPENAI_API_BASE: https://one-api.magickchat.com/v1
OPENAI_OPENAI_KEY: sk-KJovDffgJBdYB1ypxxxBdEb98157b079d44
AZURE_OPENAI_KEY: ef0f2781b5a24b15baaaaaaaaaaaaaaaaaaaaaaa AZURE_OPENAI_ENDPOINT: https://xxxxx.openai.azure.com/ AZURE_OPENAI_API_VERSION: "2023-05-15"
YIYAN_CLIENT_ID: xxxxxxxxxxxxxxxxxx YIYAN_SECRET: xxxxxxxxxxxxxxxxxxxxx
VOICE_EXECUTOR_MAX_WORKERS: 2
TTS_TYPE: azure-tts
AZURE_TTS_KEY: 7800b422c21346c79cceeb1f22bb9ac9 AZURE_TTS_SERVICE_REGION: eastasia
ELEVENLABS_TTS_KEY: a920b73991e68d5c9c9aaaaaaaaaaaaaaaa ELEVENLABS_TTS_MODEL: eleven_multilingual_v2
OPENAI_TTS_KEY: sk-1a3lt9eKXUxxxxx5fcNiPoUiAy OPENAI_TTS_MODEL: tts-1
AUDIO_DOWNLOAD_URL: http://82.xxx.8:8082 AUDIO_SAVE_PATH: /audio
MQTT_BROKER_HOST: emqx MQTT_BROKER_PORT: 1883 MQTT_CLIENT_ID: folotoy MQTT_USERNAME: folotoy MQTT_PASSWORD: folotoy
SPEECH_UDP_SERVER_HOST: 82.xxx.8 SPEECH_UDP_SERVER_PORT: 8085
提示roles配置有问题,但是我是按照新的文档设置的, 重新pull compose up 过也不行,麻烦帮忙看看如何处理?
DEBUG - Recording file created: /audio/recording-87570dd688224038bc8bc50926216b61.wav folotoy-server-self-hosting-folotoy-1 | 2023-12-17 21:30:16,218 - DEBUG - Current dkey=a0a3b30ec998 role=2 folotoy-server-self-hosting-folotoy-1 | 2023-12-17 21:30:16,218 - WARNING - Dkey a0a3b30ec998: role=2 config not found, please check your roles.json folotoy-server-self-hosting-folotoy-1 | 2023-12-17 21:30:16,218 - DEBUG - Publish topic: /user/folotoy/a0a3b30ec998/thing/command/call, msg: {"msgId": 4, "identifier": "audioplay_cmd", "inputParams": {"recordingId": 3, "total": 0}}
配置文件是在的
}, "2": { "model": "gpt-3.5-turbo", "start_text": "你好,俺是东北兔,请问有什么俺可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“东北兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50>个字!", "max_message_count": 10, "temperature": 0.7, "stt_type":"azure-stt", "sst_config": { "language": "zh-CN", "service_region": "asiaeast" }, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0,
},