需要 github 中的 acheong08 对 EdgeGPT 进行一些解释

问题描述 投票:0回答:1

所以我最近发现了这个 github 项目:https://github.com/acheong08/EdgeGPT

它作为 bing ai 的 api 工作。我用过几次。我发现最有趣的事情是它没有任何代币限制。我个人一次性发送了 58k 代币,效果很好。有人能告诉我这怎么可能吗?以我有限的知识,我无法弄清楚这里发生了什么。

如果有人解释这个库是如何工作的,那将会非常有帮助。 截至目前,当我尝试使用它时,我收到错误。 这是一个最小的可重现示例:

from EdgeGPT.EdgeUtils import Query

user_prompt="write me a code to check if a number is even or odd"
a = str(Query(user_prompt, style="precise", cookie_files="templates\cookies.json"))
print(a)

这是错误:

BingChat|DEBUG   |2023-10-12T19:32:44+0530|Importing cookies from: cookies.json
Traceback (most recent call last):
  File "c:\Users\iamga\OneDrive\Desktop\codes\Gpt_Web_Personal\trial.py", line 4, in <module>
    a = str(Query(user_prompt, style="precise", cookie_files="templates\cookies.json"))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\iamga\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\EdgeGPT\EdgeUtils.py", line 158, in __init__
    self.log_and_send_query(echo, echo_prompt)
  File "C:\Users\iamga\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\EdgeGPT\EdgeUtils.py", line 163, in log_and_send_query
    self.response = asyncio.run(self.send_to_bing(echo, echo_prompt))
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\iamga\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\EdgeGPT\EdgeUtils.py", line 187, in send_to_bing
    bot = await Chatbot.create(cookies=Cookie.current_data)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\iamga\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\EdgeGPT\EdgeGPT.py", line 41, in create
    self.chat_hub = ChatHub(
                    ^^^^^^^^
  File "C:\Users\iamga\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\EdgeGPT\chathub.py", line 42, in __init__
    conversation_signature=conversation.struct["conversationSignature"],
                           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'conversationSignature'

我该如何解决这个问题?

python github bing-api
1个回答
0
投票

我也有同样的问题。你解决了吗?

© www.soinside.com 2019 - 2024. All rights reserved.