Harry-Jing / nonebot-plugin-bing-chat

一个可以使用新版Bing进行聊天的NoneBot插件
GNU General Public License v3.0
170 stars 13 forks source link

最新的edgegpt中,cookies是需要代入解析好的参数,而不是path #76

Open ljlVink opened 1 year ago

ljlVink commented 1 year ago

EdgeGPT.py

line 287-298

class _Conversation:
    """
    Conversation API
    """

    def __init__(
        self,
        proxy: str | None = None,
        async_mode: bool = False,
        cookies: list[dict] | None = None,
    ) -> None:
        if async_mode:

cookies需要提前被解析成dict带入

在本项目中 main.py bingchat_command_chat中 Chatbot创建时,需要带入cookies参数

f=open(plugin_data.current_cookies_file_path)
d=json.loads(f.read())
f.close()
current_user_data.chatbot = Chatbot(                
    cookies=d,  # type: ignore 应该支持Path的
    proxy=plugin_config.bingchat_proxy,
)