ugorsahin / TalkingHeads

A library to communicate with ChatGPT, Claude, Copilot, Gemini, HuggingChat, and Pi
MIT License
278 stars 57 forks source link

Unable to find the text prompt area. Please raise an issue with verbose=True #62

Closed ishandutta2007 closed 1 week ago

ishandutta2007 commented 8 months ago

Code:

from talkingheads import ChatGPTClient
chathead = ChatGPTClient(
    cold_start=True,
    incognito=False,
    headless=False,
    user_data_dir='/Users/ishandutta2007/Library/Application Support/BraveSoftware/Brave-Browser/Default'
)
answer = chathead.interact("Hello, how are you today")
print(answer)

Command:

python mycodefile.py  --verbose=True

Error:

Traceback (most recent call last): File "index.py", line 65, in answer = chathead.interact("Hello, how are you today") File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/talkingheads/model_library/chatgpt.py", line 133, in interact raise RuntimeError( RuntimeError: Unable to find the text prompt area. Please raise an issue with verbose=True

ishandutta2007 commented 8 months ago

Probably it looks for prompt box assuming the login is already done, but it is not. Even though ChatGPT_UNAME and ChatGPT_PWD that I exported is correct but The thing is OpenAI username-password login rarely works for me, so I always chose login with google which always works. Maybe thats the issue, is there a option to enable login with google ?

ishandutta2007 commented 8 months ago

For HuggingChat there's an additional popup which ask you to confirm . probably thats what makes the prompt box invisible.

Traceback (most recent call last): File "index.py", line 117, in answer = chathead.interact("Hello, how are you today") File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/talkingheads/model_library/huggingchat.py", line 85, in interact text_area.send_keys(each_line) File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 231, in send_keys self._execute( File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute return self._parent.execute(command, params) File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute self.error_handler.check_response(response) File "/Users/ishandutta2007/.pyenv/versions/3.8.0/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable (Session info: chrome=122.0.6261.69)

ugorsahin commented 8 months ago

For HuggingChat, have you logged in the UI to accept Privacy and Terms?

For ChatGPT, it seems like you are not in the chat page but somewhere else, perhaps in robot verification page. I will take a look at that

ishandutta2007 commented 8 months ago

@ugorsahin I use hugging chat, so I am aware of login. Just one click to accept the popup is required in case it pops up, maybe it's browser specific (I am on Brave).

I'll try to send you a pull requests when I have time. Its simpler that way than trying to explain here.

ugorsahin commented 8 months ago

Hmm, that's strange. I've tried several times, but I still can't seem to encounter the popup you mentioned. Could you please send me a screenshot of the popup? Popups are frustrating, but I'm sure we'll figure out a solution.

isMMa commented 7 months ago

I have the same error:

imagen

imagen

ugorsahin commented 1 week ago

Closed due to inactivity.