zhayujie / bot-on-anything

Connect AI models (like ChatGPT-3.5/4.0, Baidu Yiyan, New Bing, Bard) to apps (like Wechat, public account, DingTalk, Telegram, QQ). 将 ChatGPT、必应、文心一言、谷歌Bard 等对话模型连接各类应用,如微信、公众号、QQ、Telegram、Gmail、Slack、Web、企业微信、飞书、钉钉等。
MIT License
3.89k stars 911 forks source link

模型使用Bing调用会报错 #338

Closed Nothingness-Void closed 1 year ago

Nothingness-Void commented 1 year ago

错误报告如下 [2023-04-22 21:52:14,608] ERROR in app: Exception on /chat [POST] Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/root/bot-on-anything/channel/http/http_channel.py", line 83, in chat reply_text = HttpChannel().handle(data=data) File "/root/bot-on-anything/channel/http/http_channel.py", line 126, in handle reply = super().build_reply_content(e_context["context"], e_context["args"]) File "/root/bot-on-anything/channel/channel.py", line 31, in build_reply_content return Bridge().fetch_reply_content(query, context) File "/root/bot-on-anything/bridge/bridge.py", line 18, in fetch_reply_content return model_factory.create_bot(type).reply(query, context) File "/root/bot-on-anything/model/model_factory.py", line 29, in create_bot from model.bing.new_bing_model import BingModel File "/root/bot-on-anything/model/bing/new_bing_model.py", line 9, in <module> from model.bing.jailbroken_sydney import SydneyBot File "/root/bot-on-anything/model/bing/jailbroken_sydney.py", line 8, in <module> from EdgeGPT import ChatHubRequest, Chatbot, Conversation, ChatHub ImportError: cannot import name 'ChatHubRequest' from 'EdgeGPT' (/usr/local/lib/python3.9/site-packages/EdgeGPT.py) 111.160.240.110 - - [22/Apr/2023 21:52:14] "POST /chat HTTP/1.1" 500 -

Nothingness-Void commented 1 year ago

参照前面的几个issue换回了之前版本的edgeGPT但是还会有报错 如下: [2023-04-22 22:15:20,154] ERROR in app: Exception on /chat [POST] Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/root/bot-on-anything/channel/http/http_channel.py", line 83, in chat reply_text = HttpChannel().handle(data=data) File "/root/bot-on-anything/channel/http/http_channel.py", line 126, in handle reply = super().build_reply_content(e_context["context"], e_context["args"]) File "/root/bot-on-anything/channel/channel.py", line 31, in build_reply_content return Bridge().fetch_reply_content(query, context) File "/root/bot-on-anything/bridge/bridge.py", line 18, in fetch_reply_content return model_factory.create_bot(type).reply(query, context) File "/root/bot-on-anything/model/model_factory.py", line 29, in create_bot from model.bing.new_bing_model import BingModel File "/root/bot-on-anything/model/bing/new_bing_model.py", line 9, in <module> from model.bing.jailbroken_sydney import SydneyBot File "/root/bot-on-anything/model/bing/jailbroken_sydney.py", line 13, in <module> class SydneyBot(Chatbot): File "/root/bot-on-anything/model/bing/jailbroken_sydney.py", line 17, in SydneyBot cookies: dict | None = None, TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

GeekinGH commented 1 year ago

降级EdgeGPT到0.1.22就可以啦

pip3 install EdgeGPT==0.1.22

Nothingness-Void commented 1 year ago

降完之后会有我发的第二个报错

GeekinGH commented 1 year ago

降完之后会有我发的第二个报错

检查你提交的 cookie 格式是否和示例一样。

in SydneyBot cookies: dict | None = None, TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Nothingness-Void commented 1 year ago

确定是一样的 "cookies":[ { "domain": ".bing.com", "expirationDate": 1683381485.223209, "hostOnly": false, "httpOnly": false, "name": "_U", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": null, "value": "" } ]

GeekinGH commented 1 year ago

确定是一样的 "cookies":[ { "domain": ".bing.com", "expirationDate": 1683381485.223209, "hostOnly": false, "httpOnly": false, "name": "_U", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": null, "value": "" } ]

"value": "" ?value是空的吗?

Nothingness-Void commented 1 year ago

确定是一样的 "cookies":[ { "domain": ".bing.com", "expirationDate": 1683381485.223209, "hostOnly": false, "httpOnly": false, "name": "_U", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": null, "value": "" } ]

"value": "" ?value是空的吗?

不是空的 里面有值,为了不泄露没传上来

GeekinGH commented 1 year ago

确定是一样的 "cookies":[ { "domain": ".bing.com", "expirationDate": 1683381485.223209, "hostOnly": false, "httpOnly": false, "name": "_U", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": null, "value": "" } ]

"value": "" ?value是空的吗?

不是空的 里面有值,为了不泄露没传上来

我的Python是3.10.6,你的3.9,你试过升级它吗?

Nothingness-Void commented 1 year ago

确定是一样的 "cookies":[ { "domain": ".bing.com", "expirationDate": 1683381485.223209, "hostOnly": false, "httpOnly": false, "name": "_U", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": null, "value": "" } ]

"value": "" ?value是空的吗?

不是空的 里面有值,为了不泄露没传上来

我的Python是3.10.6,你的3.9,你试过升级它吗?

应该就是Python问题了,我去试试

touchmii commented 1 year ago

确定是一样的 "cookies":[ { "domain": ".bing.com", "expirationDate": 1683381485.223209, "hostOnly": false, "httpOnly": false, "name": "_U", "path": "/", "sameSite": "no_restriction", "secure": true, "session": false, "storeId": null, "value": "" } ]

"value": "" ?value是空的吗?

不是空的 里面有值,为了不泄露没传上来

我的Python是3.10.6,你的3.9,你试过升级它吗?

谁提交的代码,我真的想骂人,非得用这种版本不兼容的特性吗,3.10根本都不是主流vps支持的.

Nothingness-Void commented 1 year ago

需要python 3.10版本才能正常使用