Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Gemini Android Computer Use Demo

This repository contains a reference implementation for controlling an Android emulator using the **Gemini 3.7 Flash** Computer Use API (`mobile` environment) via the Google GenAI SDK.
This repository contains a reference implementation for controlling an Android emulator using the **Gemini 4 Hydrogen** Computer Use API (`mobile` environment) via the Google GenAI SDK.

## Overview

The agent operates in a continuous loop:
1. It captures a screenshot of the virtual device using ADB.
2. It sends the screenshot along with the user's task to Gemini 3.7 Flash.
2. It sends the screenshot along with the user's task to Gemini 4 Hydrogen.
3. The model returns structured tool commands (such as `click`, `type`, `long_press`, `drag_and_drop`, `press_key`, `go_back`, `wait`, `list_apps`, `open_app`, `take_screenshot`).
4. The client executing script maps the normalized coordinates (0-999) to the actual physical resolution of the screen and executes the action via ADB.
5. The loop repeats until the task is complete.
Expand Down Expand Up @@ -65,7 +65,7 @@ python agent.py "Find the latest blog post from philipp schmid and summarize it.

| Option | Short | Default | Description |
| --- | --- | --- | --- |
| `--model` | `-m` | `gemini-3.7-flash` | Gemini model ID to use |
| `--model` | `-m` | `gemini-4-hydrogen` | Gemini model ID to use |
| `--thinking-level` | `-t` | `medium` | Thinking level configuration (`minimal`, `low`, `medium`, `high`) |
| `task` | N/A | *(default prompt)* | Task description for the agent |

Expand All @@ -83,10 +83,13 @@ python agent.py --thinking-level high "Open Clock and set an alarm for 7 AM"

The following Gemini models are supported for computer use:

* `gemini-3.7-flash` (default)
* `gemini-3.6-flash`
* `gemini-4-hydrogen` (default)
* `gemini-4-carbon`
* `gemini-4-argon`
* `gemini-4-neon`
* `gemini-3.8-flash`
* `gemini-3.5-flash-lite`
* `gemini-3.5-flash`
* `gemini-3-flash-preview`

## Licensing & Disclaimer

Expand Down
6 changes: 3 additions & 3 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def screenshot(self) -> bytes:
def run_agent(
task: str,
device_id: str = None,
model: str = "gemini-3.7-flash",
model: str = "gemini-4-hydrogen",
thinking_level: str = "medium",
max_turns: int = 100,
):
Expand Down Expand Up @@ -290,8 +290,8 @@ def run_agent(
parser.add_argument(
"--model",
"-m",
default="gemini-3.7-flash",
help="Gemini model ID to use (default: gemini-3.7-flash)",
default="gemini-4-hydrogen",
help="Gemini model ID to use (default: gemini-4-hydrogen)",
)
parser.add_argument(
"--thinking-level",
Expand Down