terry3041 / pyChatGPT

An unofficial Python wrapper for OpenAI's ChatGPT API
GNU General Public License v3.0
1.35k stars 255 forks source link

TimeoutException #142

Open puchen8229 opened 1 year ago

puchen8229 commented 1 year ago

My code is simple and it used to work well. But today it gave a TimeoutException

image

Any help is welcome

mylc2010 commented 1 year ago

chatgpt has new prompt

sontung2310 commented 1 year ago

My code also gave TimeoutException today? Have anyone solve this problem?

sam2332 commented 1 year ago

image Im having the same issue, timeout on the drive, its resetting the conversation before it gets the response.

sam2332 commented 1 year ago

image here is another screenshot with more logging

MundoBoss commented 1 year ago

My code also gave TimeoutException today? Have anyone solve this problem?

sam2332 commented 1 year ago

This was the first time even trying to use the library and it didn't work for me.

On Tue, Mar 21, 2023, 5:03 PM MundoBoss @.***> wrote:

My code also gave TimeoutException today? Have anyone solve this problem?

— Reply to this email directly, view it on GitHub https://github.com/terry3041/pyChatGPT/issues/142#issuecomment-1478576110, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VW5MZRZOS3E3X7BAA3W5IJSHANCNFSM6AAAAAAVYDSCNM . You are receiving this because you commented.Message ID: @.***>

MundoBoss commented 1 year ago

It work well for me since today !

AM9988 commented 1 year ago

OpenAI seems to detect that using selenium web driver so it erase all the conversation immediately after the response

sam2332 commented 1 year ago

Are you positive? Cuz I was reading the code and I believe this is due to it. Trying to get the conversation ID and failing.

On Tue, Mar 21, 2023, 8:05 PM AM9988 @.***> wrote:

OpenAI seems to detect that using selenium web driver so it erase all the conversation immediately after the response

— Reply to this email directly, view it on GitHub https://github.com/terry3041/pyChatGPT/issues/142#issuecomment-1478746222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VQCVZQBFJNCQ4LS5Y3W5I65FANCNFSM6AAAAAAVYDSCNM . You are receiving this because you commented.Message ID: @.***>

AM9988 commented 1 year ago

Ok, now I am close. Yes, the code is the reason, now the conversation is there. Let me see what is causing the issue

AM9988 commented 1 year ago

Solved

AM9988 commented 1 year ago

Are you positive? Cuz I was reading the code and I believe this is due to it. Trying to get the conversation ID and failing. On Tue, Mar 21, 2023, 8:05 PM AM9988 @.> wrote: OpenAI seems to detect that using selenium web driver so it erase all the conversation immediately after the response — Reply to this email directly, view it on GitHub <#142 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VQCVZQBFJNCQ4LS5Y3W5I65FANCNFSM6AAAAAAVYDSCNM . You are receiving this because you commented.Message ID: @.>

Just comment on that code for now and force the conversation id to anything like 0 and it will be solved. like this """if not matches: print("No match and reset") self.reset_conversation() WebDriverWait(self.driver, 5).until( EC.element_to_be_clickable(chatgpt_chats_list_first_node) ).click() time.sleep(0.5) matches = pattern.search(self.driver.current_url) conversation_id = matches.group()""" return {'message': content, 'conversation_id': 0}

sam2332 commented 1 year ago

Awesome, thank you! We should make a pull request at least commenting out the code so that the mainline package works.

On Tue, Mar 21, 2023, 9:55 PM AM9988 @.***> wrote:

Are you positive? Cuz I was reading the code and I believe this is due to it. Trying to get the conversation ID and failing. … <#m1594613769798550845> On Tue, Mar 21, 2023, 8:05 PM AM9988 @.> wrote: OpenAI seems to detect that using selenium web driver so it erase all the conversation immediately after the response — Reply to this email directly, view it on GitHub <#142 (comment) https://github.com/terry3041/pyChatGPT/issues/142#issuecomment-1478746222>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VQCVZQBFJNCQ4LS5Y3W5I65FANCNFSM6AAAAAAVYDSCNM https://github.com/notifications/unsubscribe-auth/AAHG3VQCVZQBFJNCQ4LS5Y3W5I65FANCNFSM6AAAAAAVYDSCNM . You are receiving this because you commented.Message ID: @.>

Just comment on that code for now and force the conversation id to 0 and it will be solved. like this """if not matches: print("No match and reset") self.reset_conversation() WebDriverWait(self.driver, 5).until( EC.element_to_be_clickable(chatgpt_chats_list_first_node) ).click() time.sleep(0.5) matches = pattern.search(self.driver.current_url) conversation_id = matches.group()""" return {'message': content, 'conversation_id': 0}

— Reply to this email directly, view it on GitHub https://github.com/terry3041/pyChatGPT/issues/142#issuecomment-1478813573, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VSZITKLJRKVPJNKGGTW5JLXRANCNFSM6AAAAAAVYDSCNM . You are receiving this because you commented.Message ID: @.***>

MundoBoss commented 1 year ago

Doing this it get me: Traceback (most recent call last): File "/PROJECT.py", line 173, in new_product_description = resp["message"] TypeError: 'NoneType' object is not subscriptable

Where line 173 is:                 new_product_description = resp["message"]
and line 172:                 resp = api.send_message("The question I want to get the answer of")

Here my edit: Capture-d-e-cran-2023-03-22-a-10-21-03

MundoBoss commented 1 year ago

Sorry I miss the force id = 0 part ! Work now thanks guys !

AM9988 commented 1 year ago

return {'message': content, 'conversation_id': 0}

hi, you should not comment on this line return {'message': content, 'conversation_id': 0}. However, that was a quick fix but now chatGPT is back to reserve the conversations which means you can use the original file without any modification. Best luck

sam2332 commented 1 year ago

Confirmed! Just tested it and it's working.

Thank you.

On Thu, Mar 23, 2023, 4:43 AM Ahmed Aladi @.***> wrote:

return {'message': content, 'conversation_id': 0}

hi, you should not comment on this line return {'message': content, 'conversation_id': 0}. However, that was a quick fix but now chatGPT is back to reserve the conversations which means you can use the original file without any modification. Best luck

— Reply to this email directly, view it on GitHub https://github.com/terry3041/pyChatGPT/issues/142#issuecomment-1480791276, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHG3VVPWSZR2GSLXCW7MTTW5QEKLANCNFSM6AAAAAAVYDSCNM . You are receiving this because you were mentioned.Message ID: @.***>

MundoBoss commented 1 year ago

Hey ! Do you think this: https://github.com/terry3041/pyChatGPT/issues/145 is related to this issue ?