Anthropic::ComputerUseTool
Inherits JSON::Serializable < Anthropic::ServerTool < JSON::Serializable < Struct < Value < Object
Computer use tool - allows Claude to interact with a computer desktop
An agent tool for controlling a computer through screenshots, mouse, and keyboard. Requires the computer use beta header.
message = client.messages.create(
model: Anthropic::Model::CLAUDE_SONNET_4_6,
max_tokens: 4096,
server_tools: [Anthropic::ComputerUseTool.new(display_width_px: 1920, display_height_px: 1080)],
messages: [{role: "user", content: "Open the browser and navigate to example.com"}]
)
Constructors
new(display_width_px : Int32, display_height_px : Int32, allowed_callers : Array(String) | Nil = nil, cache_control : CacheControl | Nil = nil, defer_loading : Bool | Nil = nil, display_number : Int32 | Nil = nil, enable_zoom : Bool | Nil = nil, input_examples : Array(JSON::Any) | Nil = nil, strict : Bool | Nil = nil)
Sourcenew(pull : JSON::PullParser)
Computer use tool - allows Claude to interact with a computer desktop
An agent tool for controlling a computer through screenshots, mouse, and keyboard. Requires the computer use beta header.
message = client.messages.create(
model: Anthropic::Model::CLAUDE_SONNET_4_6,
max_tokens: 4096,
server_tools: [Anthropic::ComputerUseTool.new(display_width_px: 1920, display_height_px: 1080)],
messages: [{role: "user", content: "Open the browser and navigate to example.com"}]
)
new(*, __pull_for_json_serializable pull : JSON::PullParser)
SourceInstance methods
allowed_callers
Sourcecache_control
Sourcedefer_loading
Sourceinput_examples
Sourcename
Sourcestrict
Sourcetype
Source