Closed realnoob007 closed 5 months ago
Did you specify your tokens in secrets.json?
Or you can setup with this for convenience:
from poe_api_wrapper import PoeServer
tokens = [
{"p-b": "XXXXXXXX", "p-lat": "XXXXXXXX"},
{"p-b": "XXXXXXXX", "p-lat": "XXXXXXXX"},
{"p-b": "XXXXXXXX", "p-lat": "XXXXXXXX"}
]
PoeServer(tokens=tokens)
Can you try again with new version. The app.state got ignored when using cli
Running with the version you provided, I think it is working now. But I got the following error, maybe it's about the internet connections issue?
2024-06-21 14:01:29.959 | INFO | poe_api_wrapper.bundles:init_window:41 - Web data initialized
2024-06-21 14:01:29.961 | INFO | poe_api_wrapper.bundles:get_form_key:82 - Retrieved formkey successfully: 0e4ef955677c72cacd8367dc315203ff
2024-06-21 14:01:30,310 INFO HTTP Request: GET https://poe.com/api/settings "HTTP/2 200 OK"
2024-06-21 14:01:30,917 INFO HTTP Request: POST https://poe.com/api/gql_POST "HTTP/2 200 OK"
2024-06-21 14:01:51,979 ERROR [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。 - goodbye
2024-06-21 14:01:51.979 | WARNING | poe_api_wrapper.async_api:on_ws_close:294 - Connection to remote host was lost. Reconnecting...
2024-06-21 14:01:51,980 ERROR error from callback <function AsyncPoeApi.connect_ws.
Are you using Clash or any 3rd proxy client? If so please try implementing this code:
import os
os.environ["http_proxy"] = "http://127.0.0.1:7890"
os.environ["https_proxy"] = "http://127.0.0.1:7890"
os.environ["all_proxy"] = "socks5://127.0.0.1:7890"
Thanks a lot, this works well.
After setting up the openai api endpoint by setting up secrets.json and running api.py, I get the following error making the request: { "model": "gpt-3.5-turbo", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "hello, how are you?" } ] } ] }
Error: 127.0.0.1:52791 - - [21/Jun/2024:12:59:29] "POST /v1/chat/completions" 500 21 2024-06-21 12:59:29,818 ERROR Exception inside application: 'State' object has no attribute 'tokens' Traceback (most recent call last): File "D:\miniconda\envs\py3.11\Lib\site-packages\starlette\datastructures.py", line 699, in getattr return self._state[key]