Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With proxy, websocket error #143

Closed
wupan-olo opened this issue Apr 16, 2024 · 1 comment
Closed

With proxy, websocket error #143

wupan-olo opened this issue Apr 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wupan-olo
Copy link

env:

  • macos m2
  • python 3.9+
  • poe-api-wrapper 1.4.1
# model
gpt_4_128 = 'vizcacha'
gpt_4 = 'beaver'
gpt_35 = 'gpt3_5'

# proxy 
proxy_config = [
    {"https":"socks5://127.0.0.1:7890",
     "http":"socks5://127.0.0.1:7890"}
]

msg = 'Hi, introduce yourself'

client = poe.PoeApi(cookie=poe_token, proxy=proxy_config)
 # no-stream read:
for chunk in client.send_message(bot= gpt_35, message = msg):
   pass
print(chunk["text"])

It work well for print(client.get_chat_history()['data'])

err log:

/Users/wupan/anaconda3/envs/prompt/lib/python3.9/site-packages/websocket/_app.py:356: ResourceWarning: unclosed <socket.socket fd=79, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.31.8.156', 60556)>
return not isinstance(e, KeyboardInterrupt)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
2024-04-16 10:29:12.936 | INFO | poe_api_wrapper.api:select_proxy:80 - Connection failed with {'https': 'socks5://127.0.0.1:7890', 'http': 'socks5://127.0.0.1:7890'}. Trying 1/1 ...
2024-04-16 10:29:13.835 | WARNING | poe_api_wrapper.api:on_ws_close:201 - Connection to remote host was lost. Reconnecting...
2024-04-16 10:29:20.631 | WARNING | poe_api_wrapper.api:on_ws_close:201 - Connection to remote host was lost. Reconnecting...

@snowby666 snowby666 added the bug Something isn't working label Jun 17, 2024
@snowby666
Copy link
Owner

This is be fixed in v.1.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants