Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClickTool Should Better Handle Hallucinated and Invisible Links #4066

Closed
cancan101 opened this issue May 3, 2023 · 3 comments
Closed

ClickTool Should Better Handle Hallucinated and Invisible Links #4066

cancan101 opened this issue May 3, 2023 · 3 comments
Assignees

Comments

@cancan101
Copy link
Contributor

As of now if a hallucinated link is handed to the ClickTool, it will wait for 30 seconds and then fail. Instead it should generate a message that is added to the prompt along the lines of: "I was unable to find that element. Could you suggest another approach?"

In addition it might be handed an element that is invisible (or for which there are multiple matching elements the first of which is invisible). Similarly, the Tool will wait until the element becomes visible, which may never happen (e.g. for mobile pages where some of the nav buttons are hidden). There are a few options here, one is to use force=True when clicking. Other options are to filter to visible elements using one of the approaches in: microsoft/playwright#2370 or https://www.programsbuzz.com/article/playwright-selecting-visible-elements.

@vowelparrot
Copy link
Contributor

Thank you for the recommendation! This is a great suggestion. Would you be interested in drafting a PR? i'd be happy to help out

@cancan101
Copy link
Contributor Author

I put up an initial PR.
The force option doesn't work if the element is not visible.

I wonder if get_elements should be modified to return visible elements.

dev2049 pushed a commit that referenced this issue May 25, 2023
Undertone0809 pushed a commit to Undertone0809/langchain that referenced this issue Jun 19, 2023
@dosubot
Copy link

dosubot bot commented Sep 6, 2023

Hi, @cancan101! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

Based on my understanding, the issue you raised was about the ClickTool failing when given a hallucinated link and waiting indefinitely for invisible elements to become visible. There have been some discussions in the comments, and it seems that a possible solution is to use the force=True option when clicking or filtering for visible elements.

It looks like you have already put up an initial PR, and there was a suggestion from a user named vowelparrot to modify the get_elements function to return visible elements.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 6, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants