Erol444 / gpt4-openai-api

Python package that provides (unofficial) API access to the GPT-4 through chat.openai.com. Works with langchain. Supports browsing, DALL-E 3, plugins, continuing generation.
165 stars 38 forks source link

Doesn't handle the new chatgpt ui #10

Closed Nadeus closed 1 year ago

Nadeus commented 1 year ago

Hey,

There's now this purple button and the tool doesn't manage to send any message on chatgpt

image

Is there a way you could solve this?

Lesliefans0-0 commented 1 year ago

Oh, do you fix that? Seems we have to do something

Lesliefans0-0 commented 1 year ago

Hey my friend, I've fixed the bug! I'm very glad to share with you. Check your browser version in chrome, type in"chrome://version", you may see your browser to be 113 or 114. But you have to use 112 instead because new ones are not supported by "undetected_chromedriver". Based on your OS(win, linux or mac), you have to halt your chrome auto update. For my mac, I just delete /Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle

After that, in the project, just modify gpt4_openai/driver.py 's line 480, copy this line to twice! from: textbox.send_keys(Keys.ENTER) to: textbox.send_keys(Keys.ENTER) textbox.send_keys(Keys.ENTER)

it works for me well. @Nadeus

Nadeus commented 1 year ago

Hey @Lesliefans0-0 thanks for your message! How did you manage to downgrade chrome on macos?

Erol444 commented 1 year ago

Hi @Nadeus @Lesliefans0-0 , I think it's best to just use reverse-engineered API of chatgpt (eg V1 of https://github.com/acheong08/ChatGPT) - should be more stable compared to their GUI. I will just rebase this library to theirs, so this one will still be usable (but a bit redundant). Thoughts? Thanks, Erik

Nadeus commented 1 year ago

Would this library still work? Would I have to rewrite something on my end? On my side, the less work I have the better

Erol444 commented 1 year ago

@Nadeus I plan to update this library to be based on that library (instead of Selenium), so at the end this library would just be a simple wrapper, and your code would still work.

Nadeus commented 1 year ago

Perfect for me then! What would we lose?

Erol444 commented 1 year ago

hopefully nothing:) it would just be a different approach which would make this library more stable / future-proof (like openai changing some ui on their app)

Nadeus commented 1 year ago

Then I'm all in!!!

Lesliefans0-0 commented 1 year ago

Thank you all! I've already gone to the new repo. Can run with just a few lines easily.