Skip to main content

Overview

This guide shows how to get started with Google’s Gemini 2.5 Computer Use in minutes using Orgo to control a virtual desktop environment.

Setup

Install the required packages:
pip
Set up your API keys in a .env file:
.env
Or export them as environment variables:
terminal

Complete Example

Here’s a full working example that handles the complete agent loop:
example.py

Usage Examples

Basic Tasks

Complex Workflows

Key Concepts

System Prompt

The system prompt provides crucial context to Gemini about the Ubuntu environment:
This ensures Gemini knows to:
  • Double-click desktop icons to open applications
  • Single-click menu items and buttons
  • Use appropriate keyboard shortcuts

Getting Your Computer ID

Get your computer_id from the Orgo dashboard:
  1. Go to https://orgo.ai/workspaces
  2. Click on your project
  3. Find your computer ID in the computer list
  4. Use it in: Computer(computer_id="your-computer-id")

The Agent Loop

Gemini Computer Use works in a continuous loop:
  1. Request → Send task with screenshot to the model
  2. Action → Model suggests actions (click, type, etc.)
  3. Execute → Your code executes the actions
  4. Screenshot → Capture the result
  5. Repeat → Continue until task is complete

Image Format Conversion

Important: Orgo returns screenshots in JPEG format, but Gemini requires PNG format:

URL Tracking

Important: Gemini Computer Use requires the current URL in every function response:

Coordinate System

Gemini uses normalized coordinates (0-999) that must be converted to actual pixels:
Orgo’s default screen resolution is 1024x768.

Action Types

Tool Compatibility

Orgo provides methods corresponding to Gemini’s computer use tools:

Best Practices

1. Clear Instructions

2. Use System Prompts

Always include a system prompt with Ubuntu-specific instructions:

3. Convert Coordinates

Always denormalize Gemini’s normalized coordinates (0-999):

4. Handle Image Format

Always convert JPEG screenshots to PNG:

5. Include URL in Responses

Always include the current URL:

6. Add Delays

Comparison with Claude and OpenAI

Limitations

  • Preview Status: Computer Use is in preview and may have unexpected behaviors
  • Browser Focus: Optimized for browser-based tasks
  • Coordinate System: Requires conversion from normalized to actual pixels
  • Image Format: Requires PNG format (Orgo returns JPEG, must convert)
  • URL Requirement: Must include URL in every function response
  • Rate Limits: Subject to Gemini API rate limits

Troubleshooting

Model doesn’t double-click desktop icons

Make sure you’re including the system prompt with Ubuntu-specific instructions:

INVALID_ARGUMENT: Unable to process input image

This error occurs when Gemini receives a JPEG image instead of PNG. Make sure you’re using the get_screenshot_png() function.

INVALID_ARGUMENT: Requires URL in function response

Always include the url field in your response data:

Missing API Key

Ensure both environment variables are set in your .env file:

Next Steps

Gemini Docs

Official Gemini API documentation

Orgo Quickstart

Learn more about Orgo’s virtual desktops

API Reference

Complete Orgo API documentation