pininkara / BingChatBot

Bing chat Telegram bot using Python and unofficial EdgeGPT API
Apache License 2.0
54 stars 21 forks source link

"Infinity polling exception: 'messages'" #4

Closed kamil-malinski closed 1 year ago

kamil-malinski commented 1 year ago

I'm always getting this error:

root@python:~/BingChatBot# python3 bing.py
Receive: Hi
2023-03-16 16:41:50,739 (__init__.py:960 MainThread) ERROR - TeleBot: "Infinity polling exception: 'messages'"
2023-03-16 16:41:50,740 (__init__.py:962 MainThread) ERROR - TeleBot: "Exception traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/telebot/__init__.py", line 955, in infinity_polling
    self.polling(non_stop=True, timeout=timeout, long_polling_timeout=long_polling_timeout,
  File "/usr/local/lib/python3.10/dist-packages/telebot/__init__.py", line 1043, in polling
    self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
  File "/usr/local/lib/python3.10/dist-packages/telebot/__init__.py", line 1118, in __threaded_polling
    raise e
  File "/usr/local/lib/python3.10/dist-packages/telebot/__init__.py", line 1074, in __threaded_polling
    self.worker_pool.raise_exceptions()
  File "/usr/local/lib/python3.10/dist-packages/telebot/util.py", line 148, in raise_exceptions
    raise self.exception_info
  File "/usr/local/lib/python3.10/dist-packages/telebot/util.py", line 91, in run
    task(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/telebot/__init__.py", line 6428, in _run_middlewares_and_handler
    result = handler['function'](message)
  File "/root/BingChatBot/bing.py", line 49, in response_all
    responseList = asyncio.run(bingChat(message.text))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/root/BingChatBot/bing.py", line 65, in bingChat
    response_dict = await gbot.ask(prompt=messageText, conversation_style=ConversationStyle.creative)
  File "/usr/local/lib/python3.10/dist-packages/EdgeGPT.py", line 279, in ask
    async for final, response in self.chat_hub.ask_stream(
  File "/usr/local/lib/python3.10/dist-packages/EdgeGPT.py", line 242, in ask_stream
    yield False, response["arguments"][0]["messages"][0][
KeyError: 'messages'

does anybody know what's the problem?

locoda commented 1 year ago

You may want to update EdgeGPT to newer version

pininkara commented 1 year ago

This is a problem with EdgeGPT, you can solve it by upgrading EdgeGPT.Please use this command: pip install -U EdgeGPT