@@ -25,6 +25,66 @@ class HybridBrowserToolkit(BaseToolkit):
2525 This wrapper allows users to choose between:
2626 - 'typescript': WebSocket-based implementation using TypeScript/Node.js
2727 - 'python': Pure Python implementation using Playwright directly
28+
29+ Args:
30+ mode (Literal["typescript", "python"]): Implementation mode. -
31+ 'typescript': Uses WebSocket-based TypeScript implementation -
32+ 'python': Uses pure Python Playwright implementation. Defaults to
33+ "typescript".
34+ headless (bool): Whether to run browser in headless mode.
35+ Defaults to True.
36+ user_data_dir (Optional[str]): Directory for user data
37+ persistence. Defaults to None.
38+ stealth (bool): Whether to enable stealth mode. Defaults to
39+ False.
40+ web_agent_model (Optional[BaseModelBackend]): Model for web
41+ agent operations. Defaults to None.
42+ cache_dir (str): Directory for caching. Defaults to "tmp/".
43+ enabled_tools (Optional[List[str]]): List of enabled tools.
44+ Defaults to None.
45+ browser_log_to_file (bool): Whether to log browser actions to
46+ file. Defaults to False.
47+ log_dir (Optional[str]): Custom directory path for log files.
48+ If None, defaults to "browser_log". Defaults to None.
49+ session_id (Optional[str]): Session identifier. Defaults to None.
50+ default_start_url (str): Default URL to start with. Defaults
51+ to "https://google.com/".
52+ default_timeout (Optional[int]): Default timeout in
53+ milliseconds. Defaults to None.
54+ short_timeout (Optional[int]): Short timeout in milliseconds.
55+ Defaults to None.
56+ navigation_timeout (Optional[int]): Navigation timeout in
57+ milliseconds. Defaults to None.
58+ network_idle_timeout (Optional[int]): Network idle timeout in
59+ milliseconds. Defaults to None.
60+ screenshot_timeout (Optional[int]): Screenshot timeout in
61+ milliseconds. Defaults to None.
62+ page_stability_timeout (Optional[int]): Page stability timeout
63+ in milliseconds. Defaults to None.
64+ dom_content_loaded_timeout (Optional[int]): DOM content loaded
65+ timeout in milliseconds. Defaults to None.
66+ viewport_limit (bool): Whether to filter page snapshot
67+ elements to only those visible in the current viewport.
68+ Defaults to False.
69+ connect_over_cdp (bool): Whether to connect to an existing
70+ browser via Chrome DevTools Protocol. Defaults to False.
71+ (Only supported in TypeScript mode)
72+ cdp_url (Optional[str]): WebSocket endpoint URL for CDP
73+ connection. Required when connect_over_cdp is True.
74+ Defaults to None. (Only supported in TypeScript mode)
75+ cdp_keep_current_page (bool): When True and using CDP mode,
76+ won't create new pages but use the existing one. Defaults to False.
77+ (Only supported in TypeScript mode)
78+ full_visual_mode (bool): When True, browser actions like click,
79+ browser_open, visit_page, etc. will return 'full visual mode'
80+ as snapshot instead of actual page content. The
81+ browser_get_page_snapshot method will still return the actual
82+ snapshot. Defaults to False.
83+ **kwargs: Additional keyword arguments passed to the
84+ implementation.
85+
86+ Returns:
87+ HybridBrowserToolkit instance of the specified implementation.
2888 """
2989
3090 def __new__ (
0 commit comments