pub struct BrowserToolset { /* private fields */ }Expand description
A toolset that provides all browser automation tools.
Use this to add all browser tools to an agent at once, or use individual tools for more control.
Implementations§
Source§impl BrowserToolset
impl BrowserToolset
Sourcepub fn new(browser: Arc<BrowserSession>) -> Self
pub fn new(browser: Arc<BrowserSession>) -> Self
Create a new toolset with all tools enabled.
Sourcepub fn with_pool(pool: Arc<BrowserSessionPool>) -> Self
pub fn with_pool(pool: Arc<BrowserSessionPool>) -> Self
Create a pool-backed toolset with all tools enabled.
Sessions are resolved per-user at runtime via Toolset::tools(ctx).
The pool calls get_or_create(ctx.user_id()) to obtain an isolated
browser session for each user.
§Example
use adk_browser::{BrowserToolset, BrowserSessionPool, BrowserConfig};
use std::sync::Arc;
let pool = Arc::new(BrowserSessionPool::new(BrowserConfig::default()));
let toolset = BrowserToolset::with_pool(pool);Sourcepub fn with_pool_and_profile(
pool: Arc<BrowserSessionPool>,
profile: BrowserProfile,
) -> Self
pub fn with_pool_and_profile( pool: Arc<BrowserSessionPool>, profile: BrowserProfile, ) -> Self
Create a pool-backed toolset with a pre-configured profile.
Combines pool-backed session resolution with profile-based tool category selection.
§Example
use adk_browser::{BrowserToolset, BrowserProfile, BrowserSessionPool, BrowserConfig};
use std::sync::Arc;
let pool = Arc::new(BrowserSessionPool::new(BrowserConfig::default()));
let toolset = BrowserToolset::with_pool_and_profile(pool, BrowserProfile::Minimal);Sourcepub fn with_profile(
browser: Arc<BrowserSession>,
profile: BrowserProfile,
) -> Self
pub fn with_profile( browser: Arc<BrowserSession>, profile: BrowserProfile, ) -> Self
Create a toolset with a pre-configured profile.
This is the recommended way to create a toolset for most agents.
Using BrowserProfile::Full is equivalent to BrowserToolset::new().
Enable or disable navigation tools.
Sourcepub fn with_interaction(self, enabled: bool) -> Self
pub fn with_interaction(self, enabled: bool) -> Self
Enable or disable interaction tools.
Sourcepub fn with_extraction(self, enabled: bool) -> Self
pub fn with_extraction(self, enabled: bool) -> Self
Enable or disable extraction tools.
Sourcepub fn with_screenshot(self, enabled: bool) -> Self
pub fn with_screenshot(self, enabled: bool) -> Self
Enable or disable screenshot tool.
Enable or disable cookie management tools.
Sourcepub fn with_windows(self, enabled: bool) -> Self
pub fn with_windows(self, enabled: bool) -> Self
Enable or disable window/tab management tools.
Sourcepub fn with_frames(self, enabled: bool) -> Self
pub fn with_frames(self, enabled: bool) -> Self
Enable or disable frame/iframe management tools.
Sourcepub fn with_actions(self, enabled: bool) -> Self
pub fn with_actions(self, enabled: bool) -> Self
Enable or disable advanced action tools.