Exception: Failed to refresh session!
from revChatGPT.ChatGPT import Chatbot ...: ...: chatbot = Chatbot({ ...: "session_token": "<YOUR_TOKEN>" ...: }, conversation_id=None, parent_id=None) # You can start a custom conversation ...: ...: response = chatbot.ask("Prompt", conversation_id=None, parent_id=None) # You can specify custom conversation and parent ids. ...: Otherwise it uses the saved conversation (yes. conversations are automatically saved) ...: ...: print(response) ...: # { ...: # "message": message, ...: # "conversation_id": self.conversation_id, ...: # "parent_id": self.parent_id, ...: # } Spawning browser... Browser spawned. Found Cloudflare Cookie! Failed to refresh session! Failed to refresh session! Failed to refresh session! Failed to refresh session! Failed to refresh session! Failed to refresh session!
Exception Traceback (most recent call last) File /opt/homebrew/Caskroom/mambaforge/base/lib/python3.9/site-packages/revChatGPT/ChatGPT.py:230, in Chatbot.refresh_session(self, session_token) 229 elif response.status_code != 200 or response.json() == {} or "accessToken" not in response.json(): --> 230 raise Exception(f'Response code: {response.status_code} \n Response: {response.text}') 231 else:
Exception: Response code: 200 Response: {}
The above exception was the direct cause of the following exception:
Exception Traceback (most recent call last) Cell In[2], line 3 1 from revChatGPT.ChatGPT import Chatbot ----> 3 chatbot = Chatbot({ 4 "session_token": "<YOUR_TOKEN>" 5 }, conversation_id=None, parent_id=None) # You can start a custom conversation 7 response = chatbot.ask("Prompt", conversation_id=None, parent_id=None) # You can specify custom conversation and parent ids. Otherwise it uses the saved conversation (yes. conversations are automatically saved) 9 print(response)
File /opt/homebrew/Caskroom/mambaforge/base/lib/python3.9/site-packages/revChatGPT/ChatGPT.py:81, in Chatbot.init(self, config, conversation_id, parent_id, no_refresh) 79 else: 80 raise Exception("Invalid config!") ---> 81 self.retry_refresh()
File /opt/homebrew/Caskroom/mambaforge/base/lib/python3.9/site-packages/revChatGPT/ChatGPT.py:92, in Chatbot.retry_refresh(self) 90 except Exception as exc: 91 if retries == 0: ---> 92 raise exc 93 retries -= 1
File /opt/homebrew/Caskroom/mambaforge/base/lib/python3.9/site-packages/revChatGPT/ChatGPT.py:88, in Chatbot.retry_refresh(self) 86 while refresh: 87 try: ---> 88 self.refresh_session() 89 refresh = False 90 except Exception as exc:
File /opt/homebrew/Caskroom/mambaforge/base/lib/python3.9/site-packages/revChatGPT/ChatGPT.py:245, in Chatbot.refresh_session(self, session_token) 243 self.email_login(self.solve_captcha()) 244 else: --> 245 raise Exception("Failed to refresh session!") from exc
Exception: Failed to refresh session!
+1
+1
Official API is out. Use that instead. Readme has been updated