Need some explanation on EdgeGPT by acheong08 in github

819 Views Asked by At

so i recently discovered this github project : https://github.com/acheong08/EdgeGPT

it works as a api for bing ai. I used it a few times. the most fascinating thing I found is it doesn't have any token limits. I personally sent 58k tokens in one prompt and it worked fine. can someone tell me how is that possible? with my limited knowledge I'm not able to find out what's going on in here.

It'd be very helpful if someone explains how this library is working. As of now when i try to use it I'm getting an error. here is a minimal reproducible example :

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)

and here is the error :

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'

how can i fix this problem?

0

There are 0 best solutions below