Skip to content

API Reference parrot_tools.computer.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.computer.models

View source

Data models for the Computer-Use Agent feature (FEAT-227).

All models are pure Pydantic v2 BaseModel subclasses with no external dependencies beyond pydantic itself.

Class ComputerTask

A reusable sequence of natural-language instructions.

Tasks are named, described, and composed of ordered natural-language steps. They can be parameterised for use inside run_loop().

Fields:

Field Type Default Description
name str Unique task name (used as a key in the toolkit's task store).
description str Human-readable description of the task's purpose.
steps list[str] Ordered list of natural-language instructions for the model.
params_schema Optional[dict] None Optional JSON Schema dict for validating params passed at runtime (e.g. when iterating over a list of records).

Class ComputerUseConfig

Configuration for the ComputerUse tool type in GoogleGenAIClient.

Controls which environment the computer-use model operates in and which predefined functions (actions) are excluded.

Fields:

Field Type Default Description
environment str 'ENVIRONMENT_BROWSER' The environment string — always ENVIRONMENT_BROWSER for browser automation.
excluded_actions list[str] List of predefined function names to exclude from the model's available action set.

Class EnvState

State returned after each computer-use action.

Every action executed by the AsyncComputerBackend captures a screenshot and the current URL, returning them as an EnvState.

Fields:

Field Type Default Description
screenshot bytes Raw PNG bytes of the current viewport.
url str The current page URL after the action.

Class LoopResult

Result of a loop execution.

Captures how many iterations completed, the reason the loop stopped, per-iteration results, and any errors encountered.

Fields:

Field Type Default Description
task_name str Name of the task that was looped.
iterations_completed int Total number of iterations that ran.
stop_reason Literal['count', 'condition_met', 'max_reached', 'aborted', 'error'] One of "count", "condition_met", "max_reached", "aborted", or "error".
results list[TaskResult] List of per-iteration TaskResult objects.
errors list[str] List of error messages from failed iterations.

Class TaskResult

Result of a single task execution.

Captures whether the task succeeded, any screenshots taken during execution, optionally extracted data, and the final URL.

Fields:

Field Type Default Description
task_name str Name of the task that was executed.
success bool Whether the task completed without errors.
screenshots list[bytes] List of PNG bytes captured during the task.
extracted_data Optional[dict] None Optional structured data extracted during the task.
error Optional[str] None Error message if the task failed; None on success.
url str '' The page URL at the end of the task.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally