Zero6992 / chatGPT-discord-bot

Integrate ChatGPT into your own discord bot
GNU General Public License v2.0
2.63k stars 701 forks source link

Is this not working with "unofficial" api? I thought i could use it for free. #310

Closed jirafey closed 1 year ago

jirafey commented 1 year ago

C:\Users\jiraf\chatGPT-discord-bot>python -m main Traceback (most recent call last): File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn conn.connect() File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connection.py", line 416, in connect self.sock = ssl_wrapsocket( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\ssl.py", line 449, in ssl_wrap_socket ssl_sock = _ssl_wrap_socketimpl( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\ssl.py", line 493, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket return self.sslsocket_class._create( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1070, in _create self.do_handshake() File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1341, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 489, in send resp = conn.urlopen( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen retries = retries.increment( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/session (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\jiraf\chatGPT-discord-bot\main.py", line 1, in from src import bot File "C:\Users\jiraf\chatGPT-discord-bot\src\bot.py", line 5, in from src.aclient import client File "C:\Users\jiraf\chatGPT-discord-bot\src\aclient.py", line 142, in client = aclient() File "C:\Users\jiraf\chatGPT-discord-bot\src\aclient.py", line 32, in init self.chatbot = self.get_chatbot_model() File "C:\Users\jiraf\chatGPT-discord-bot\src\aclient.py", line 36, in get_chatbot_model return AsyncChatbot(config={"email": self.openAI_email, "password": self.openAI_password, "session_token": self.chatgpt_session_token, "model": self.openAI_gpt_engine, "paid": self.chatgpt_paid}) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 679, in init super().init( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 58, in wrapper out = func(*args, kwargs) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 163, in init self.__check_credentials() File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 58, in wrapper out = func(*args, *kwargs) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 187, in __check_credentials self.login() File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 58, in wrapper out = func(args, kwargs) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\revChatGPT\V1.py", line 328, in login auth.get_access_token() File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\OpenAIAuth.py", line 314, in get_access_token response = self.session.get( File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 600, in get return self.request("GET", url, kwargs) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 587, in request resp = self.send(prep, send_kwargs) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\sessions.py", line 701, in send r = adapter.send(request, **kwargs) File "C:\Users\jiraf\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\adapters.py", line 563, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='explorer.api.openai.com', port=443): Max retries exceeded with url: /api/auth/session (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:997)')))

jirafey commented 1 year ago

also I later figured out that it would be useful to add to .env file #whether you using UNOFFICIAL

xCrazyIan commented 1 year ago

Having a similar issue. Logging in with OpenAI User/Pass, and model as UNOFFICIAL.

Zero6992 commented 1 year ago

https://github.com/acheong08/ChatGPT/issues/1236

Email/Password authentication is dead

jirafey commented 1 year ago

so it has nothing to do with mine certificate? I will be happy to help with some logs if needed

jirafey commented 1 year ago

acheong08/ChatGPT#1236

Email/Password authentication is dead

@Zero6992 can you provide a short guide what to do to use access token instead Email/Password authentication? I'm sure other people with this issue would also benefit from that.

Zero6992 commented 1 year ago

added it