canxin121 / Async-Poe-Client

Async Client for poe.com
45 stars 5 forks source link

bot has no chats attribute #16

Closed asce0 closed 1 year ago

asce0 commented 1 year ago

this is the bot objects that returned from poe {'bot': {'isNode': 'Bot', 'typename': 'Bot', 'baseModelDisplayName': 'GPT-4', 'botId': 3007, 'deletionState': 'not_deleted', 'displayName': 'GPT-4', 'handle': 'GPT-4', 'id': 'Qm90OjMwMDc=', 'image': {'__typename': 'LocalBotImage', 'localName': 'Avatar_GPT_Blue'}, 'isApiBot': False, 'isDown': False, 'isLimitedAccess': True, 'isPrivateBot': False, 'isSystemBot': True, 'limitedAccessType': 'soft_limit', 'messageLimit': {'dailyLimit': 1, 'id': 'TWVzc2FnZUxpbWl0Om1vZGVsOjMwMDc=', 'numMessagesRemaining': 594, 'shouldShowRemainingMessageCount': False, 'shouldShowSubscriptionRationale': False}, 'nickname': 'beaver', 'uploadFileSizeLimit': 100000000, 'viewerIsCreator': False}}

    and this is the error message : Exception: Failed to send msg to GPT-4: 'chats'
asce0 commented 1 year ago

@canxin121 Exception: Failed to send msg to GPT-4: Failed to send query: Server Error

canxin121 commented 1 year ago

Give the code your are using,

lijiansu commented 1 year ago

同样的问题:Cell In[8], line 6 4 text+=message 5 await asyncio.sleep(3) ----> 6 chat_code = poe_client.bot_code_dict[name][0] 7 async for message in poe_client.ask_stream(url_botname='ChatGPT', question="写1句诗词", chat_code=chat_code,suggest_able= False): 8 print(message, end="")

File c:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\async_poe_client\client.py:64, in Poe_Client.bot_code_dict(self) 62 @property 63 def bot_code_dict(self): ---> 64 return { 65 bot: [chat for chat in data["chats"]] for bot, data in self.bots.items() 66 }

File c:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\async_poe_client\client.py:65, in (.0) 62 @property 63 def bot_code_dict(self): 64 return { ---> 65 bot: [chat for chat in data["chats"]] for bot, data in self.bots.items() 66 }

KeyError: 'chats'

lijiansu commented 1 year ago

获取不到chat_code,如何解决

canxin121 commented 1 year ago

应该已经修复了,更新试试. It seem this has been fixed in the last push, try update your lib to latest.