RockChinQ / revLibs

ChatGPT、Claude QQ 机器人,以插件形式为 QChatGPT 项目接入ChatGPT、Claude、Bard、gpt4free等接口的逆向工程库
210 stars 17 forks source link

使用EdgeGPT时遭遇报错 #72

Closed RubiscoQAQ closed 1 year ago

RubiscoQAQ commented 1 year ago
[2023-03-16 08:46:34.037] procmsg.py (25) - [INFO] : [rev] 收到person_*******消息: 你好
[2023-03-16 08:46:34.038] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py
[2023-03-16 08:46:34.038] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助”
Traceback (most recent call last):
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message
    for section in session.get_reply(prompt):
  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply
    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):
  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply
    resp = asyncio.run(task)
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream
    await self.wss.send_str(append_identifier(self.request.struct))
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
[2023-03-16 08:46:34.039] procmsg.py (61) - [WARNING] : 失,重试(1/3)...

如下图:每次重载插件后的第一条消息可以正常回复。之后就会遇到上述报错。 QQ截图20230316164947

RockChinQ commented 1 year ago

到config.py把logging_level设置为logging.debug,重启查看调试级别的日志信息,再把报错前后的一版信息发上来,注意是在主程序的配置文件config.py中修改

---原始邮件--- 发件人: @.> 发送时间: 2023年3月16日(周四) 下午4:52 收件人: @.>; 抄送: @.***>; 主题: [RockChinQ/revLibs] 使用EdgeGPT时遭遇报错 (Issue #72)

[2023-03-16 08:46:34.037] procmsg.py (25) - [INFO] : [rev] 收到person_***消息: 你好 [2023-03-16 08:46:34.038] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py [2023-03-16 08:46:34.038] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助” Traceback (most recent call last): File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, **kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply resp = asyncio.run(task) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask async for final, response in self.chat_hub.ask_stream( File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream await self.wss.send_str(append_identifier(self.request.struct)) File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str await self._writer.send(data, binary=False, compress=compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport [2023-03-16 08:46:34.039] procmsg.py (61) - [WARNING] : 失,重试(1/3)...
如下图:每次重载插件后的第一条消息可以正常回复。之后就会遇到上述报错。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

RubiscoQAQ commented 1 year ago
[2023-03-16 09:10:22.562] host.py (105) - [INFO] : 初始化插件
[2023-03-16 09:10:22.562] main.py (78) - [INFO] : [rev] 已加载逆向库acheong08/EdgeGPT, 使用接口实现类: <class 'plugins.revLibs.pkg.process.impls.edgegpt.EdgeGPTImpl'>
[2023-03-16 09:10:22.562] main.py (94) - [INFO] : [rev] 已将主程序消息处理超时时间设置为10分钟
[2023-03-16 09:10:22.562] host.py (113) - [INFO] : 插件 revLibs 已初始化
[2023-03-16 09:10:32.325] protocol.py (1177) - [DEBUG] : < TEXT '{"syncId":"-1","data":{"type":"FriendMessage","...","remark":"Rubisco"}}}' [217 bytes]
[2023-03-16 09:10:32.339] host.py (280) - [DEBUG] : 触发事件: person_message_received (1)
[2023-03-16 09:10:32.340] host.py (322) - [DEBUG] : 事件 person_message_received (1) 处理完毕,返回值: {}
[2023-03-16 09:10:32.340] session.py (124) - [DEBUG] : person_1245144245,lock acquire,<unlocked _thread.lock object at 0x7fe7f583fed0>
[2023-03-16 09:10:32.340] session.py (126) - [DEBUG] : person_1245144245,lock acquire successfully,<locked _thread.lock object at 0x7fe7f583fed0>
[2023-03-16 09:10:32.341] host.py (280) - [DEBUG] : 触发事件: person_normal_message_received (2)
[2023-03-16 09:10:32.341] procmsg.py (25) - [INFO] : [rev] 收到person_1245144245消息: 不错不错
[2023-03-16 09:10:32.341] revss.py (39) - [DEBUG] : [rev] 逆向接口实现为EdgeGPTImpl
[2023-03-16 09:10:32.342] edgegpt.py (35) - [DEBUG] : [rev] 初始化接口实现,使用账户cookies: [{'domain': '.bing.com', 'host
[2023-03-16 09:10:33.093] _client.py (1022) - [DEBUG] : HTTP Request: GET https://edgeservices.bing.com/edgesvc/turing/conversation/create "HTTP/1.1 200 OK"
[2023-03-16 09:10:33.095] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
[2023-03-16 09:10:33.454] _client.py (1022) - [DEBUG] : HTTP Request: GET https://edgeservices.bing.com/edgesvc/turing/conversation/create "HTTP/1.1 200 OK"
[2023-03-16 09:10:33.455] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py
[2023-03-16 09:10:33.456] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助”
[2023-03-16 09:10:33.456] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
[2023-03-16 09:10:34.574] main.py (286) - [INFO] : 热重载完成
[2023-03-16 09:10:35.066] protocol.py (1270) - [DEBUG] : % sending keepalive ping
[2023-03-16 09:10:35.066] protocol.py (1183) - [DEBUG] : > PING '*֊(' [text, 4 bytes]
[2023-03-16 09:10:35.067] protocol.py (1177) - [DEBUG] : < PONG '*֊(' [text, 4 bytes]
[2023-03-16 09:10:35.067] protocol.py (1280) - [DEBUG] : % received keepalive pong
[2023-03-16 09:10:39.581] connectionpool.py (1003) - [DEBUG] : Starting new HTTPS connection (1): api.github.com:443
[2023-03-16 09:10:39.897] connectionpool.py (456) - [DEBUG] : https://api.github.com:443 "GET /repos/RockChinQ/QChatGPT/releases HTTP/1.1" 200 3152
[2023-03-16 09:10:39.899] main.py (312) - [INFO] : 当前已是最新版本
[2023-03-16 09:10:39.900] connectionpool.py (1003) - [DEBUG] : Starting new HTTPS connection (1): api.github.com:443
[2023-03-16 09:10:40.600] connectionpool.py (456) - [DEBUG] : https://api.github.com:443 "GET /repos/RockChinQ/QChatGPT/contents/res/announcement HTTP/1.1" 200 298
[2023-03-16 09:10:46.277] edgegpt.py (49) - [DEBUG] : {
    "type": 2,
    "invocationId": "0",
    "item": {
        "messages": [
            {
                "text": "如果我之后想获取帮助,请你说“输入!help获取帮助” \n不错不错",
                "author": "user",
                "from": {
                    "id": "844425455216448",
                    "name": null
                },
                "createdAt": "2023-03-16T09:10:33.932544+00:00",
                "timestamp": "2023-03-16T09:10:33.9299164+00:00",
                "locale": "en-us",
                "market": "en-us",
                "region": "us",
                "messageId": "1bd837fd-8db5-4998-abbb-e949067ca1a6",
                "requestId": "1bd837fd-8db5-4998-abbb-e949067ca1a6",
                "offense": "None",
                "feedback": {
                    "tag": null,
                    "updatedOn": null,
                    "type": "None"
                },
                "contentOrigin": "cib",
                "privacy": null,
                "inputMethod": "Keyboard"
            },
            {
                "text": "你好,这是必应。我可以用中文和你交流。😊\n如果你之后想获取帮助,请输入!help获取帮助。",
                "author": "bot",
                "createdAt": "2023-03-16T09:10:41.0428601+00:00",
                "timestamp": "2023-03-16T09:10:41.0428601+00:00",
                "messageId": "7bcf3e0b-2282-4d32-84d4-e4f23c253cc2",
                "requestId": "1bd837fd-8db5-4998-abbb-e949067ca1a6",
                "offense": "None",
                "adaptiveCards": [
                    {
                        "type": "AdaptiveCard",
                        "version": "1.0",
                        "body": [
                            {
                                "type": "TextBlock",
                                "text": "你好,这是必应。我可以用中文和你交流。😊\n如果你之后获取帮助,请输入!help获取帮助。\n",
                                "wrap": true
                            }
                        ]
                    }
                ],
                "sourceAttributions": [],
                "feedback": {
                    "tag": null,
                    "updatedOn": null,
                    "type": "None"
                },
                "contentOrigin": "DeepLeo",
                "privacy": null,
                "suggestedResponses": [
                    {
                        "text": "!help",
                        "author": "user",
                        "createdAt": "2023-03-16T09:10:46.1651693+00:00",
                        "timestamp": "2023-03-16T09:10:46.1651693+00:00",
                        "messageId": "8ae8b7b1-2ed0-45ba-8719-843d3b464ccd",
                        "messageType": "Suggestion",
                        "offense": "Unknown",
                        "feedback": {
                            "tag": null,
                            "updatedOn": null,
                            "type": "None"
                        },
                        "contentOrigin": "DeepLeo",
                        "privacy": null
                    },
                    {
                        "text": "你会说其他语言吗?",
                        "author": "user",
                        "createdAt": "2023-03-16T09:10:46.1651724+00:00",
                        "timestamp": "2023-03-16T09:10:46.1651724+00:00",
                        "messageId": "58794fa2-15d3-4942-97d0-05d3d9f77948",
                        "messageType": "Suggestion",
                        "offense": "Unknown",
                        "feedback": {
                            "tag": null,
                            "updatedOn": null,
                            "type": "None"
                        },
                        "contentOrigin": "DeepLeo",
                        "privacy": null
                    },
                    {
                        "text": "给我讲一个笑话。",
                        "author": "user",
                        "createdAt": "2023-03-16T09:10:46.1651728+00:00",
                        "timestamp": "2023-03-16T09:10:46.1651728+00:00",
                        "messageId": "c5a8aa77-5a21-461c-9e41-ea3c4be5c69e",
                        "messageType": "Suggestion",
                        "offense": "Unknown",
                        "feedback": {
                            "tag": null,
                            "updatedOn": null,
                            "type": "None"
                        },
                        "contentOrigin": "DeepLeo",
                        "privacy": null
                    }
                ],
                "spokenText": "如果你之后想获取帮助,请输入!help获取帮助"
            }
        ],
        "firstNewMessageIndex": 1,
        "conversationId": "51D|BingProd|934D1D93F47A52FBE5462A057E12CBB96EE94F3480F210EC7682ED71F76C701A",
        "requestId": "1bd837fd-8db5-4998-abbb-e949067ca1a6",
        "conversationExpiryTime": "2023-03-16T15:10:46.2419551Z",
        "shouldInitiateConversation": true,
        "telemetry": {
            "metrics": null,
            "startTime": "2023-03-16T09:10:33.9299759Z"
        },
        "throttling": {
            "maxNumUserMessagesInConversation": 15,
            "numUserMessagesInConversation": 1
        },
        "result": {
            "value": "Success",
            "serviceVersion": "20230315.99"
        }
    }
}
[2023-03-16 09:10:46.278] main.py (104) - [DEBUG] : [rev] 你好,这是必应。我可以用中文和你交流。😊
如果你之后想获取帮助,请输入!help获取帮助。

本次对话: 1/15
[2023-03-16 09:10:46.279] host.py (311) - [DEBUG] : 插件 revLibs 已要求阻止事件 person_normal_message_received 的默认行为
[2023-03-16 09:10:46.279] host.py (319) - [DEBUG] : 插件 revLibs 阻止了后序插件的执行
[2023-03-16 09:10:46.279] host.py (322) - [DEBUG] : 事件 person_normal_message_received (2) 处理完毕,返回值: {'reply': [['[聪明的墨菲特]:你好,这是必应。我可以用中文和你交流。😊\n如果你之后想获取帮助,请输入!help获取帮助。\n\n本次对话: 1/15']]}
[2023-03-16 09:10:46.279] process.py (156) - [INFO] : 回复[person_1245144245]文字消息:[聪明的墨菲特]:你好,这是必应。我可以用中文和你交流。😊
如果你之后想获取帮助,请输入!help获取帮助。

本次对话: 1/15
[2023-03-16 09:10:46.280] session.py (131) - [DEBUG] : person_1245144245,lock release,<locked _thread.lock object at 0x7fe7f583fed0>
[2023-03-16 09:10:46.280] session.py (133) - [DEBUG] : person_1245144245,lock release successfully,<unlocked _thread.lock object at 0x7fe7f583fed0>
[2023-03-16 09:10:46.281] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
[2023-03-16 09:10:46.281] protocol.py (1183) - [DEBUG] : > TEXT '{"syncId": "714758", "command": "sendFriendMess...u5bf9\\u8bdd: 1/15"}]}}' [461 bytes]
[2023-03-16 09:10:46.551] protocol.py (1177) - [DEBUG] : < TEXT '{"syncId":"714758","data":{"code":0,"msg":"success","messageId":36033}}' [71 bytes]
[2023-03-16 09:10:51.526] protocol.py (1177) - [DEBUG] : < TEXT '{"syncId":"-1","data":{"type":"FriendMessage","...","remark":"Rubisco"}}}' [214 bytes]
[2023-03-16 09:10:51.605] host.py (280) - [DEBUG] : 触发事件: person_message_received (3)
[2023-03-16 09:10:51.605] host.py (322) - [DEBUG] : 事件 person_message_received (3) 处理完毕,返回值: {}
[2023-03-16 09:10:51.606] session.py (124) - [DEBUG] : person_1245144245,lock acquire,<unlocked _thread.lock object at 0x7fe7f583fed0>
[2023-03-16 09:10:51.606] session.py (126) - [DEBUG] : person_1245144245,lock acquire successfully,<locked _thread.lock object at 0x7fe7f583fed0>
[2023-03-16 09:10:51.606] host.py (280) - [DEBUG] : 触发事件: person_normal_message_received (4)
[2023-03-16 09:10:51.606] procmsg.py (25) - [INFO] : [rev] 收到person_1245144245消息: 你是谁
[2023-03-16 09:10:51.606] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py
[2023-03-16 09:10:51.607] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助”
[2023-03-16 09:10:51.607] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
Traceback (most recent call last):
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message
    for section in session.get_reply(prompt):
  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply
    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):
  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply
    resp = asyncio.run(task)
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 272, in ask_stream
    objects = msg.data.split(DELIMITER)
AttributeError: 'RuntimeError' object has no attribute 'split'
[2023-03-16 09:10:51.609] procmsg.py (61) - [WARNING] : 失败,重试(1/3)...
[2023-03-16 09:10:53.611] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py
[2023-03-16 09:10:53.612] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助”
[2023-03-16 09:10:53.612] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
Traceback (most recent call last):
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message
    for section in session.get_reply(prompt):
  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply
    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):
  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply
    resp = asyncio.run(task)
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream
    await self.wss.send_str(append_identifier(self.request.struct))
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
[2023-03-16 09:10:53.614] procmsg.py (61) - [WARNING] : 失败,重试(2/3)...
[2023-03-16 09:10:55.069] protocol.py (1270) - [DEBUG] : % sending keepalive ping
[2023-03-16 09:10:55.069] protocol.py (1183) - [DEBUG] : > PING 5f 83 e8 ea [binary, 4 bytes]
[2023-03-16 09:10:55.070] protocol.py (1177) - [DEBUG] : < PONG 5f 83 e8 ea [binary, 4 bytes]
[2023-03-16 09:10:55.070] protocol.py (1280) - [DEBUG] : % received keepalive pong
[2023-03-16 09:10:55.614] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py
[2023-03-16 09:10:55.615] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助”
[2023-03-16 09:10:55.615] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
Traceback (most recent call last):
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message
    for section in session.get_reply(prompt):
  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply
    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):
  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply
    resp = asyncio.run(task)
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream
    await self.wss.send_str(append_identifier(self.request.struct))
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
[2023-03-16 09:10:55.616] procmsg.py (61) - [WARNING] : 失败,重试(3/3)...
[2023-03-16 09:10:57.618] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py
[2023-03-16 09:10:57.619] revss.py (73) - [INFO] : [rev] 使用情景预设: 如果我之后想获取帮助,请你说“输入!help获取帮助”
[2023-03-16 09:10:57.619] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector
Traceback (most recent call last):
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message
    for section in session.get_reply(prompt):
  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply
    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):
  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply
    resp = asyncio.run(task)
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream
    await self.wss.send_str(append_identifier(self.request.struct))
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
[2023-03-16 09:10:57.622] main.py (108) - [ERROR] : [rev] Traceback (most recent call last):
  File "/bot/plugins/revLibs/main.py", line 101, in normal_message_received
    reply_message = procmsg.process_message(session_name=kwargs['launcher_type']+"_"+str(kwargs['launcher_id']),
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 65, in process_message
    raise e
  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message
    for section in session.get_reply(prompt):
  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply
    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):
  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply
    resp = asyncio.run(task)
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream
    await self.wss.send_str(append_identifier(self.request.struct))
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

[2023-03-16 09:10:57.622] host.py (311) - [DEBUG] : 插件 revLibs 已要求阻止事件 person_normal_message_received 的默认行为
[2023-03-16 09:10:57.622] host.py (319) - [DEBUG] : 插件 revLibs 阻止了后序件的执行
[2023-03-16 09:10:57.623] host.py (322) - [DEBUG] : 事件 person_normal_message_received (4) 处理完毕,返回值: {'reply': [['[聪明的墨菲特]:处理消息时出现错误,请联系管理员\nTraceback (most recent call last):\n  File "/bot/plugins/revLibs/main.py", line 101, in normal_message_received\n    reply_message = procmsg.process_message(session_name=kwargs[\'launcher_type\']+"_"+str(kwargs[\'launcher_id\']),\n  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 65, in process_message\n    raise e\n  File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message\n    for section in session.get_reply(prompt):\n  File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply\n    for reply_period_msg, reply_period_dict in self.__rev_interface_impl__.get_reply(prompt, **kwargs):\n  File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply\n    resp = asyncio.run(task)\n  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run\n    return loop.run_until_complete(main)\n  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete\n    return future.result()\n  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask\n    async for final, response in self.chat_hub.ask_stream(\n  File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream\n    await self.wss.send_str(append_identifier(self.request.struct))\n  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str\n    await self._writer.send(data, binary=False, compress=compress)\n  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send\n    await self._send_frame(message, WSMsgType.TEXT, compress)\n  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame\n    raise ConnectionResetError("Cannot write to closing transport")\nConnectionResetError: Cannot write to closing transport\n']]}
[2023-03-16 09:10:57.623] process.py (156) - [INFO] : 回复[person_1245144245]文字消息:[聪明的墨菲特]:处理消息时出现错误,请联系管理员
Traceback (most recent call last):
  File "/bot/plugins/revLibs/main.py", ...
RockChinQ commented 1 year ago

暂不清楚原因,可能是逆向库底层问题,主机是在国内吗?建议使用境外主机

niliovo commented 1 year ago

我也遇到了相同的问题,bing.com的域名加入了代理也不行

[2023-03-18 08:27:48.720] revss.py (39) - [DEBUG] : [rev] 逆向接口实现为EdgeGPTImpl [2023-03-18 08:27:48.721] edgegpt.py (35) - [DEBUG] : [rev] 初始化接口实现,使用账户cookies: [{'domain': '.bing.com', 'expi [2023-03-18 08:27:50.516] _client.py (1022) - [DEBUG] : HTTP Request: GET https://edgeservices.bing.com/edgesvc/turing/conversation/create "HTTP/1.1 200 OK" [2023-03-18 08:27:50.518] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector [2023-03-18 08:27:52.312] _client.py (1022) - [DEBUG] : HTTP Request: GET https://edgeservices.bing.com/edgesvc/turing/conversation/create "HTTP/1.1 200 OK" [2023-03-18 08:27:52.313] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py [2023-03-18 08:27:52.313] revss.py (73) - [INFO] : [rev] 使用情景预设: 您好,我是NewBing,是一款由人工智能驱动的AI搜索引擎(基于Chat GPT4.0的先进自然语言生成模型)。我不是真正的人,而是一个计算机程序,可以通过文本聊天来帮助您解决问题。如果您有任何问题,请随时告诉我,我将尽力回答。 如果你需要帮助,请输入 '!help' 或 '!帮助'。 [2023-03-18 08:27:52.314] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector [2023-03-18 08:27:54.524] edgegpt.py (49) - [DEBUG] : { "type": 2, "invocationId": "0", "item": { "messages": [ { "text": "您好,我是NewBing,是一款由人工智能驱动的AI搜索引擎(基于Chat GPT4.0的先进自然语言生成模型)。我不是真正的人,而是一个计算机程序,可以通过文本聊天来帮助您解决问题。如果您有任何问题,请随时告诉我,我将尽力回答。\n如果你需要帮助,请输入 '!help' 或 '!帮助'。 \n你好啊", "author": "user", "from": { "id": "1055519815034711", "name": null }, "createdAt": "2023-03-18T08:27:54.1979778+00:00", "timestamp": "2023-03-18T08:27:54.1947951+00:00", "locale": "en-us", "market": "en-us", "region": "us", "messageId": "5bef7b69-e628-404b-9768-c9d6f7edd5d1", "requestId": "5bef7b69-e628-404b-9768-c9d6f7edd5d1", "offense": "OffenseTrigger", "feedback": { "tag": null, "updatedOn": null, "type": "None" }, "contentOrigin": "cib", "privacy": null, "inputMethod": "Keyboard" }, { "author": "bot", "createdAt": "2023-03-18T08:27:54.3313943+00:00", "timestamp": "2023-03-18T08:27:54.3313943+00:00", "messageId": "89911dbf-c74a-46e2-9825-4d946f2431ac", "requestId": "5bef7b69-e628-404b-9768-c9d6f7edd5d1", "offense": "None", "adaptiveCards": [ { "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "TextBlock", "text": "Sorry! That’s on me, I can’t give a response to that right now. What else can I help you with?", "wrap": true } ] } ], "sourceAttributions": [], "feedback": { "tag": null, "updatedOn": null, "type": "None" }, "contentOrigin": "Apology", "privacy": null, "suggestedResponses": [ { "text": "Show me some recipes", "author": "user", "createdAt": "2023-02-21T04:46:19.7504688+00:00", "timestamp": "2023-02-21T04:46:19.7504688+00:00", "messageId": "8264ef6a-e3a5-4d98-8887-1a98098cdb37", "messageType": "Suggestion", "offense": "Unknown", "feedback": { "tag": null, "updatedOn": null, "type": "None" }, "contentOrigin": "Apology", "privacy": null }, { "text": "Write me a limerick", "author": "user", "createdAt": "2023-02-21T04:46:19.7504731+00:00", "timestamp": "2023-02-21T04:46:19.7504731+00:00", "messageId": "823a65b4-bef2-4f97-99c6-6b731726bcc9", "messageType": "Suggestion", "offense": "Unknown", "feedback": { "tag": null, "updatedOn": null, "type": "None" }, "contentOrigin": "Apology", "privacy": null }, { "text": "Give me a tongue twister", "author": "user", "createdAt": "2023-02-21T04:46:19.7504792+00:00", "timestamp": "2023-02-21T04:46:19.7504792+00:00", "messageId": "5ef113ca-9e53-4ff2-b34e-9ef7dc8306e8", "messageType": "Suggestion", "offense": "Unknown", "feedback": { "tag": null, "updatedOn": null, "type": "None" }, "contentOrigin": "Apology", "privacy": null } ], "spokenText": "Sorry! That’s on me, I can’t give a response to that right now. What else can I help you with?" } ], "firstNewMessageIndex": 1, "conversationId": "51D|BingProd|91C6FCE74F3D60A7E88027C9FA4165500639E55506FF1E776DD12FCFDA3D91E3", "requestId": "5bef7b69-e628-404b-9768-c9d6f7edd5d1", "conversationExpiryTime": "2023-03-18T14:27:54.3581384Z", "shouldInitiateConversation": false, "telemetry": { "metrics": null, "startTime": "2023-03-18T08:27:54.1949018Z" }, "throttling": { "maxNumUserMessagesInConversation": 15, "numUserMessagesInConversation": 1 }, "result": { "value": "Success", "serviceVersion": "20230317.110" 
} } } Traceback (most recent call last): File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 52, in get_reply body = reply_obj["text"] KeyError: 'text' [2023-03-18 08:27:54.527] procmsg.py (61) - [WARNING] : 失败,重试(1/3)... [2023-03-18 08:27:56.529] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py [2023-03-18 08:27:56.530] revss.py (73) - [INFO] : [rev] 使用情景预设: 您好,我是NewBing,是一款由人工智能驱动的AI搜索引擎(基于Chat GPT4.0的先进自然语言生成模型)。我不是真正的人,而是一个计算机程序,可以通过文本聊天来帮助您解决问题。如果您有任何问题,请随时告诉我,我将尽力回答。 如果你需要帮助,请输入 '!help' 或 '!帮助'。 [2023-03-18 08:27:56.530] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector Traceback (most recent call last): File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply resp = asyncio.run(task) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask async for final, response in self.chat_hub.ask_stream( File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 272, in ask_stream objects = msg.data.split(DELIMITER) AttributeError: 'RuntimeError' object has no attribute 'split' [2023-03-18 08:27:56.534] procmsg.py (61) - [WARNING] : 失败,重试(2/3)... [2023-03-18 08:27:58.535] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py [2023-03-18 08:27:58.535] revss.py (73) - [INFO] : [rev] 使用情景预设: 您好,我是NewBing,是一款由人工智能驱动的AI搜索引擎(基于Chat GPT4.0的先进自然语言生成模型)。我不是真正的人,而是一个计算机程序,可以通过文本聊天来帮助您解决问题。如果您有任何问题,请随时告诉我,我将尽力回答。 如果你需要帮助,请输入 '!help' 或 '!帮助'。 [2023-03-18 08:27:58.536] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector Traceback (most recent call last): File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply resp = asyncio.run(task) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask async for final, response in self.chat_hub.ask_stream( File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream await self.wss.send_str(append_identifier(self.request.struct)) File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str await self._writer.send(data, binary=False, compress=compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport [2023-03-18 08:27:58.539] procmsg.py (61) - [WARNING] : 失败,重试(3/3)... [2023-03-18 08:28:00.035] ratelimit.py (41) - [DEBUG] : 清空当前分钟的对话次数 [2023-03-18 08:28:00.541] procmsg.py (41) - [WARNING] : [rev] 逆向库不再进行长消息处理,请使用主程序的长消息处理功能,详情请查看confi-template.py [2023-03-18 08:28:00.542] revss.py (73) - [INFO] : [rev] 使用情景预设: 您好,我是NewBing,是一款由人工智能驱动的AI搜索引擎(基于Chat GPT4.0的先进自然语言生成模型)。我不是真正的人,而是一个计算机程序,可以通过文本聊天来帮助您解决问题。如果您有任何问题,请随时告诉我,我将尽力回答。 如果你需要帮助,请输入 '!help' 或 '!帮助'。 [2023-03-18 08:28:00.542] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector Traceback (most recent call last): File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply resp = asyncio.run(task) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask async for final, response in self.chat_hub.ask_stream( File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream await self.wss.send_str(append_identifier(self.request.struct)) File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str await self._writer.send(data, binary=False, compress=compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport [2023-03-18 08:28:00.543] main.py (104) - [ERROR] : [rev] Traceback (most recent call last): File "/bot/plugins/revLibs/main.py", line 97, in normal_message_received reply_message = procmsg.process_message(session_name=kwargs['launchertype']+""+str(kwargs['launcher_id']), File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 65, in process_message raise e File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply resp = asyncio.run(task) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask async for final, response in self.chat_hub.ask_stream( File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream await self.wss.send_str(append_identifier(self.request.struct)) File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str await self._writer.send(data, binary=False, compress=compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport [2023-03-18 08:28:00.544] manager.py (337) - [INFO] : 通知管理员:[rev] 处理消息时出现错误: Traceback (most recent call last): File "/bot/plugins/revLibs/main.py", line 97, in normal_message_received reply_message = procmsg.process_message(session_name=kwargs['launchertype']+""+str(kwargs['launcher_id']), File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 65, in process_message raise e File "/bot/plugins/revLibs/pkg/process/procmsg.py", line 45, in process_message for section in session.get_reply(prompt): File "/bot/plugins/revLibs/pkg/process/revss.py", line 76, in get_reply for reply_period_msg, reply_period_dict in self.rev_interface_impl.get_reply(prompt, kwargs): File "/bot/plugins/revLibs/pkg/process/impls/edgegpt.py", line 48, in get_reply resp = asyncio.run(task) File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete return future.result() File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 327, in ask async for final, response in self.chat_hub.ask_stream( File "/usr/local/lib/python3.9/site-packages/EdgeGPT.py", line 268, in ask_stream await self.wss.send_str(append_identifier(self.request.struct)) File "/usr/local/lib/python3.9/site-packages/aiohttp/client_ws.py", line 151, in send_str await self._writer.send(data, binary=False, compress=compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 690, in send await self._send_frame(message, WSMsgType.TEXT, compress) File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 601, in _send_frame raise ConnectionResetError("Cannot write to closing transport") ConnectionResetError: Cannot write to closing transport [2023-03-18 08:28:00.544] selector_events.py (54) - [DEBUG] : Using selector: EpollSelector [2023-03-18 08:28:00.545] protocol.py (1183) - [DEBUG] : > TEXT '{"syncId": "806913", "command": "sendFriendMess...osing transport\n"}]}}' [2046 bytes] [2023-03-18 08:28:00.546] host.py (311) - [DEBUG] : 插件 revLibs 已要求阻止事件 person_normal_message_received 的默认行为 [2023-03-18 08:28:00.546] host.py (319) - [DEBUG] : 插件 revLibs 阻止了后序插件的执行 [2023-03-18 08:28:00.546] host.py (322) - [DEBUG] : 事件 person_normal_message_received (1) 处理完毕,返回值: {'reply': [['[NewBing]出错了,请稍后再试']]} [2023-03-18 08:28:00.546] process.py (156) - [INFO] : 回复[person_1791356563]文字消息:[NewBing]出错了,请稍后再试

niliovo commented 1 year ago

我更新EdgeGPT插件到0.60并且修改情景预设之后可以正常使用了

niliovo commented 1 year ago

我更新EdgeGPT插件到0.60并且修改情景预设之后可以正常使用了

我错了,只是第一次可以,!reset 重置会话后也是第一次正常,再问一次就复现了

Lingpeixie commented 1 year ago

这个报错我也遇到了,第一次加载完插件reload后,每次第一句会话就报错身份验证相关 然后我把插件进行了禁用和开启,第一次对话可以正常回答,第二次仍然报错 最后我尝试重新开启Qchat后,直接用!reset 让它重置会话之后可以正常进行对话了

RockChinQ commented 1 year ago

请勿在国内主机上使用newbing