WebAgents_ / tools /go_back.py
Firoj112's picture
Upload 4 files
9cb4e3c verified
raw
history blame
449 Bytes
from typing import Any
from smolagents.tools import Tool
class GoBackTool(Tool):
name = "go_back"
description = "Goes back to the previous page."
inputs = {}
output_type = "None"
def forward(self, driver: Any = None) -> None:
if not driver:
raise ValueError("WebDriver instance is required.")
driver.back()
def __init__(self, *args, **kwargs):
self.is_initialized = False