Why when i say hello it does not respond like when it's a small response or what?
Closed this issue · 0 comments
wisamidris7 commented
from poe_api_wrapper import AsyncPoeApi
import asyncio
tokens = {
'b': "??",
'lat': "??"
}
async def main():
client = await AsyncPoeApi(cookie=tokens).create()
message = "Hello"
async for chunk in client.send_message(bot="gpt3_5", message=message):
print(chunk["response"], end='', flush=True)
asyncio.run(main())
Response
2024-06-09 00:55:06.342 | INFO | poe_api_wrapper.async_api:create:76 - Async instance created
2024-06-09 00:55:08.260 | INFO | poe_api_wrapper.async_api:send_message:679 - New Thread created | 2dd55pcwdk7gvpsqoy8
2024-06-09 00:55:18.268 | WARNING | poe_api_wrapper.async_api:send_message:776 - Retrying request 1/3 times...
Traceback (most recent call last):
File "c:\Users\Administrator\Desktop\poe-api-wrapper\example.py", line 17, in <module>
asyncio.run(main())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\nest_asyncio.py", line 30, in run
return loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\nest_asyncio.py", line 92, in run_until_complete
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\nest_asyncio.py", line 133, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 303, in __step
self.__step_run_and_handle_result(exc)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 314, in __step_run_and_handle_result
result = coro.send(None)
^^^^^^^^^^^^^^^
File "c:\Users\Administrator\Desktop\poe-api-wrapper\example.py", line 14, in main
async for chunk in client.send_message(bot="gpt3_5", message=sys.argv[1]):
File "c:\Users\Administrator\Desktop\poe-api-wrapper\poe_api_wrapper\async_api.py", line 771, in send_message
response = self.message_queues[human_message_id].get(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\queue.py", line 180, in get
self.not_empty.wait(remaining)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 359, in wait
gotit = waiter.acquire(True, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
Task exception was never retrieved
future: <Task finished name='Task-1' coro=<main() done, defined at c:\Users\Administrator\Desktop\poe-api-wrapper\example.py:10> exception=KeyboardInterrupt()>
Traceback (most recent call last):
File "c:\Users\Administrator\Desktop\poe-api-wrapper\example.py", line 17, in <module>
asyncio.run(main())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\nest_asyncio.py", line 30, in run
return loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\nest_asyncio.py", line 92, in run_until_complete
self._run_once()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\site-packages\nest_asyncio.py", line 133, in _run_once
handle._run()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 303, in __step
self.__step_run_and_handle_result(exc)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 314, in __step_run_and_handle_result
result = coro.send(None)
^^^^^^^^^^^^^^^
File "c:\Users\Administrator\Desktop\poe-api-wrapper\example.py", line 14, in main
async for chunk in client.send_message(bot="gpt3_5", message=sys.argv[1]):
File "c:\Users\Administrator\Desktop\poe-api-wrapper\poe_api_wrapper\async_api.py", line 771, in send_message
response = self.message_queues[human_message_id].get(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\queue.py", line 180, in get
self.not_empty.wait(remaining)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 359, in wait
gotit = waiter.acquire(True, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrup