File size: 449 Bytes
9cb4e3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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