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
impl ComputerUseToolset
Sourcepub fn new(actuator: Arc<dyn ComputerActuator>) -> Self
pub fn new(actuator: Arc<dyn ComputerActuator>) -> Self
The toolset over actuator, offering every member it supports.
Sourcepub fn with_display(self, width: u32, height: u32) -> Self
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.
Sourcepub fn without(self, member: ComputerUseMember) -> Self
pub fn without(self, member: ComputerUseMember) -> Self
Withholds member from the model.
Sourcepub fn with_egress(self, egress: ToolEgress) -> Self
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.
Sourcepub fn members(&self) -> Vec<ComputerUseMember>
pub fn members(&self) -> Vec<ComputerUseMember>
The members the toolset offers.
Sourcepub fn member_tools(&self) -> Vec<Arc<dyn Tool>>
pub fn member_tools(&self) -> Vec<Arc<dyn Tool>>
The member tools, one per offered member.