pub struct BrowserToolset { /* private fields */ }browser only.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>) -> BrowserToolset
pub fn new(browser: Arc<BrowserSession>) -> BrowserToolset
Create a new toolset with all tools enabled.
Sourcepub fn with_pool(pool: Arc<BrowserSessionPool>) -> BrowserToolset
pub fn with_pool(pool: Arc<BrowserSessionPool>) -> BrowserToolset
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,
) -> BrowserToolset
pub fn with_pool_and_profile( pool: Arc<BrowserSessionPool>, profile: BrowserProfile, ) -> BrowserToolset
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,
) -> BrowserToolset
pub fn with_profile( browser: Arc<BrowserSession>, profile: BrowserProfile, ) -> BrowserToolset
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) -> BrowserToolset
pub fn with_interaction(self, enabled: bool) -> BrowserToolset
Enable or disable interaction tools.
Sourcepub fn with_extraction(self, enabled: bool) -> BrowserToolset
pub fn with_extraction(self, enabled: bool) -> BrowserToolset
Enable or disable extraction tools.
Sourcepub fn with_wait(self, enabled: bool) -> BrowserToolset
pub fn with_wait(self, enabled: bool) -> BrowserToolset
Enable or disable wait tools.
Sourcepub fn with_screenshot(self, enabled: bool) -> BrowserToolset
pub fn with_screenshot(self, enabled: bool) -> BrowserToolset
Enable or disable screenshot tool.
Sourcepub fn with_js(self, enabled: bool) -> BrowserToolset
pub fn with_js(self, enabled: bool) -> BrowserToolset
Enable or disable JavaScript tools.
Enable or disable cookie management tools.
Sourcepub fn with_windows(self, enabled: bool) -> BrowserToolset
pub fn with_windows(self, enabled: bool) -> BrowserToolset
Enable or disable window/tab management tools.
Sourcepub fn with_frames(self, enabled: bool) -> BrowserToolset
pub fn with_frames(self, enabled: bool) -> BrowserToolset
Enable or disable frame/iframe management tools.
Sourcepub fn with_actions(self, enabled: bool) -> BrowserToolset
pub fn with_actions(self, enabled: bool) -> BrowserToolset
Enable or disable advanced action tools.
Trait Implementations§
Source§impl Toolset for BrowserToolset
impl Toolset for BrowserToolset
Auto Trait Implementations§
impl Freeze for BrowserToolset
impl !RefUnwindSafe for BrowserToolset
impl Send for BrowserToolset
impl Sync for BrowserToolset
impl Unpin for BrowserToolset
impl UnsafeUnpin for BrowserToolset
impl !UnwindSafe for BrowserToolset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request