Skip to main content

ComputerUseToolset

Struct ComputerUseToolset 

Source
pub struct ComputerUseToolset { /* private fields */ }
Expand description

Claude’s computer use toolset (computer_toolset_20260801) over an actuator.

The toolset offers the members the actuator supports, each as a governed tool. The model adapter collapses them into one toolset entry that offers exactly those members, or into the earlier computer_20251124 tool for a model that takes it, which needs the display size (with_display, or the actuator’s own).

§Example

use std::sync::Arc;
use adk_computer_use::ComputerUseToolset;
use adk_core::{ActuationOutput, ComputerAction, ComputerActuator, Result};
use async_trait::async_trait;

struct NoOp;

#[async_trait]
impl ComputerActuator for NoOp {
    fn display_size(&self) -> Option<(u32, u32)> {
        Some((1280, 800))
    }

    async fn perform(&self, _action: ComputerAction) -> Result<ActuationOutput> {
        Ok(ActuationOutput::Done)
    }
}

let toolset = ComputerUseToolset::new(Arc::new(NoOp));
// Zoom is withheld: the actuator does not support it.
assert_eq!(toolset.member_tools().len(), 16);

Implementations§

Source§

impl ComputerUseToolset

Source

pub fn new(actuator: Arc<dyn ComputerActuator>) -> Self

The toolset over actuator, offering every member it supports.

Source

pub fn with_display(self, width: u32, height: u32) -> Self

Sets the display size in screenshot pixels, which bounds coordinates and is declared for models that take an earlier computer use version.

Source

pub fn without(self, member: ComputerUseMember) -> Self

Withholds member from the model.

Source

pub fn with_egress(self, egress: ToolEgress) -> Self

What every acting member declares about its network use. Undeclared by default, which a run egress policy refuses; declare ToolEgress::Enforced when the environment’s traffic passes through a proxy that enforces the run’s policy.

Source

pub fn members(&self) -> Vec<ComputerUseMember>

The members the toolset offers.

Source

pub fn member_tools(&self) -> Vec<Arc<dyn Tool>>

The member tools, one per offered member.

Trait Implementations§

Source§

impl Toolset for ComputerUseToolset

Source§

fn name(&self) -> &str

Returns the name of this toolset.
Source§

fn tools<'life0, 'async_trait>( &'life0 self, _ctx: Arc<dyn ReadonlyContext>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Arc<dyn Tool>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the tools available in this toolset for the given context.
Source§

fn process_llm_request<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: Arc<dyn ReadonlyContext>, _request: &'life1 mut LlmRequest, ) -> Pin<Box<dyn Future<Output = Result<(), AdkError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Applies toolset-specific context to an LLM request before each model call. Read more
Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Releases what the toolset holds open, such as a server connection or a subprocess. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more