Spaces:
Runtime error
Runtime error
Download BrowsingAgent/tools/GoBack.py from varun324242/agent1: direct link, hf CLI and curl.
- Browser
- Download file 492 Bytes
-
https://huggingface.co/spaces/varun324242/agent1/resolve/main/BrowsingAgent/tools/GoBack.py
- Command line
-
hf download hf://spaces/varun324242/agent1/BrowsingAgent/tools/GoBack.py
-
curl -L -o GoBack.py https://huggingface.co/spaces/varun324242/agent1/resolve/main/BrowsingAgent/tools/GoBack.py
492 Bytes
| import time | |
| from agency_swarm.tools import BaseTool | |
| from .util.selenium import get_web_driver, set_web_driver | |
| class GoBack(BaseTool): | |
| """W | |
| This tool allows you to go back 1 page in the browser history. Use it in case of a mistake or if a page shows you unexpected content. | |
| """ | |
| def run(self): | |
| wd = get_web_driver() | |
| wd.back() | |
| time.sleep(3) | |
| set_web_driver(wd) | |
| return "Success. Went back 1 page. Current URL is: " + wd.current_url | |