Getting Started
This page outlines upcoming features on how to build and run desktop AI agents seamlessly within ToyStack's virtual operating system. These features are currently under development and not yet live.
Last updated
instance = client.start(instance_type="virtual_os" )# Get the status of the instance
status = instance.get_status()
# Get the streaming URL for interacting with the instance
stream_url = instance.get_stream_url()
# Capture a screenshot of the current instance view
base_64_image = instance.screenshot()
# Move the mouse cursor to specific coordinates
result = instance.computer(
action="mouse_move",
coordinate=[200, 100]
)
# Perform a left-click action
result = instance.computer(
action="left_click"
)
# Execute a bash command within the instance
result = instance.bash(
command="ls -la"
)from toystack.tools import BashTool, ComputerTool, EditTool, ToolResult
from anthropic import Anthropic
# ToolCollection definition omitted for brevity; see full example
tool_collection = ToolCollection(
ComputerTool(instance),
BashTool(instance),
EditTool(instance)
)
# Initialize Anthropic Client
anthropic_client = Anthropic(api_key="your_api_key")
# Send a message with tools enabled
response = anthropic_client.beta.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=4096,
messages=messages,
system=[{"type": "text", "text": SYSTEM_PROMPT}],
tools=tool_collection.to_params(),
betas=["computer-use-2024-10-22"]
)# Stop the instance
instance.stop()