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.93k stars 914 forks source link

配置为type:bing 服务之后,提示:error: cannot import name 'ChatHubRequest' from 'EdgeGPT' #341

Closed iT-Boyer closed 1 year ago

iT-Boyer commented 1 year ago

配置model type :bing 配置bing :

"bing":{
      "jailbreak":true,
      "jailbreak_prompt":"xxxx",
      "cookies":[{
        "domain": ".bing.com",
        "expirationDate": 1683439475.20289,
        "hostOnly": false,
        "httpOnly": false,
        "name": "_U",
        "path": "/",
        "sameSite": "no_restriction",
        "secure": true,
        "session": false,
        "storeId": null,
        "value": "1FygU....."
      }]
    }

在启动 python app.py 之后,聊天会出现错误:

[INFO][2023-04-23 14:25:59][log.py:34] - [MultiChannel] Start up bing on slack
⚡️ Bolt app is running!

Bot:
无回复

User:
hao
Bot:
[ERROR][2023-04-23 14:26:39][log.py:47] - [MultiChannel] Start up failed on terminal: cannot import name 'ChatHubRequest' from 'EdgeGPT' (/Users/boyer/.pyenv/versions/3.10.1/lib/python3.10/site-packages/EdgeGPT.py)
[ERROR][2023-04-23 14:26:39][log.py:45] - App startup failed!
[ERROR][2023-04-23 14:26:39][log.py:50] - cannot import name 'ChatHubRequest' from 'EdgeGPT' (/Users/boyer/.pyenv/versions/3.10.1/lib/python3.10/site-packages/EdgeGPT.py)
....
aixinxino commented 1 year ago

我也是这样

JimiZhou commented 1 year ago

上周EdgeGPT更新后一直是这个报错

Nothingness-Void commented 1 year ago

降级为低版本pip3 install EdgeGPT==0.1.22

lsfcode commented 1 year ago

降级为低版本pip3 install EdgeGPT==0.1.22

低版本报这个错:

[wechat_com_channel.py:61] - unsupported operand type(s) for |: 'type' and 'NoneType'
Traceback (most recent call last):
  File "/home/ubuntu/projects/bot-on-anything/channel/wechat/wechat_com_channel.py", line 57, in _do_send
    reply_text = super().build_reply_content(query, context)
  File "/home/ubuntu/projects/bot-on-anything/channel/channel.py", line 31, in build_reply_content
    return Bridge().fetch_reply_content(query, context)
  File "/home/ubuntu/projects/bot-on-anything/bridge/bridge.py", line 18, in fetch_reply_content
    return model_factory.create_bot(type).reply(query, context)
  File "/home/ubuntu/projects/bot-on-anything/model/model_factory.py", line 29, in create_bot
    from model.bing.new_bing_model import BingModel
  File "/home/ubuntu/projects/bot-on-anything/model/bing/new_bing_model.py", line 9, in <module>
    from model.bing.jailbroken_sydney import SydneyBot
  File "/home/ubuntu/projects/bot-on-anything/model/bing/jailbroken_sydney.py", line 13, in <module>
    class SydneyBot(Chatbot):
  File "/home/ubuntu/projects/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'
Nothingness-Void commented 1 year ago

对,我也一样,至今不知道该怎么解,我问bing说|是Python3.10新增的语法 你可以更换成3.10试试

charleschen2006 commented 1 year ago

一样一样的。bing模式有谁用起来了嘛?

GeekinGH commented 1 year ago

一样一样的。bing模式有谁用起来了嘛?

我有用起来,就是速度太慢。

Nothingness-Void commented 1 year ago

一样一样的。bing模式有谁用起来了嘛?

我有用起来,就是速度太慢。

能看看你的配置和服务器的python版本吗

GeekinGH commented 1 year ago

一样一样的。bing模式有谁用起来了嘛?

我有用起来,就是速度太慢。

能看看你的配置和服务器的python版本吗

Python 3.10.6 配置应该和楼主的没有区别

lsfcode commented 1 year ago

一样一样的。bing模式有谁用起来了嘛?

我有用起来,就是速度太慢。

能看看你的配置和服务器的python版本吗

换成3.10确实可用了,不过bing配置里的越狱要关掉,不然会报另外一个错。另外,bing的回复非常慢,我又换回chatgpt了,毕竟我也不太需要时效性很强的内容

charleschen2006 commented 1 year ago

可以close了。我也py升级到3.10+降级0.1.22搞定了。 确实不实用,非常慢。

abwuge commented 1 year ago

我修复了这个bug,不过速度慢无解。这是Bing的正常速度,只不过一些方案是bing回复了多少就显示多少内容,这个是bing完全回复后再显示内容。