Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Commit c35b2ac

Browse files
authored
Merge pull request #20 from labteral/improvements
Fast fix login
2 parents 1aa3c77 + ed8e85d commit c35b2ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chatgpt/chatgpt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,9 @@ def chat(self, message: List[str], retry_on_401: bool = True, direct_response: b
404404
self._cookies = {}
405405
self._session._cookies = {}
406406
self._access_token = None
407+
self.write_cache()
407408
return self.chat(message, False, direct_response=direct_response, stream=stream)
408-
elif exception_code == ChatgptErrorCodes.LOGIN_ERROR or exception_code == ChatgptErrorCodes.TIMEOUT_ERROR and retry_on_401:
409+
elif (exception_code == ChatgptErrorCodes.LOGIN_ERROR or exception_code == ChatgptErrorCodes.TIMEOUT_ERROR) and retry_on_401:
409410
return self.chat(message, False, direct_response=direct_response, stream=stream)
410411

411412
except TLSClientExeption as ex:

0 commit comments

Comments
 (0)