droidrun 0.3.3__tar.gz → 0.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {droidrun-0.3.3 → droidrun-0.3.5}/.gitignore +3 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/PKG-INFO +1 -2
- droidrun-0.3.5/docs/.generated-files.txt +4 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/docs.json +2 -3
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/concepts/agent.mdx +2 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/guides/gemini.mdx +1 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/guides/ollama.mdx +8 -4
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/guides/openailike.mdx +1 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/quickstart.mdx +1 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/sdk/adb-tools.mdx +119 -24
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/sdk/base-tools.mdx +44 -13
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/sdk/droid-agent.mdx +7 -2
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/sdk/ios-tools.mdx +39 -36
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/codeact/codeact_agent.py +13 -8
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/task_manager.py +18 -3
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/droid/droid_agent.py +35 -10
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/droid/events.py +1 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/planner/planner_agent.py +21 -15
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/utils/chat_utils.py +24 -22
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/utils/executer.py +10 -2
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/cli/main.py +49 -22
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/macro/cli.py +1 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/portal.py +23 -7
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/telemetry/events.py +1 -1
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/tools/adb.py +86 -98
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/tools/tools.py +28 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/pyproject.toml +17 -32
- droidrun-0.3.3/docs/.generated-files.txt +0 -5
- droidrun-0.3.3/docs/v3/sdk/adb-utils.mdx +0 -399
- {droidrun-0.3.3 → droidrun-0.3.5}/.github/workflows/bounty.yml +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/.github/workflows/publish.yml +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/CHANGELOG.md +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/CONTRIBUTING.md +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/LICENSE +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/MANIFEST.in +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/README.md +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/favicon.png +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/logo/dark.svg +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/logo/light.svg +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v1/concepts/agent.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v1/concepts/android-control.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v1/concepts/portal-app.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v1/overview.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v1/quickstart.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/concepts/agent.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/concepts/android-control.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/concepts/planning.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/concepts/portal-app.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/concepts/tracing.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/overview.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v2/quickstart.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/concepts/android-tools.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/concepts/models.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/concepts/portal-app.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/guides/cli.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/guides/overview.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/guides/telemetry.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/images/portal_apk.png +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/docs/v3/overview.mdx +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/__main__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/codeact/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/codeact/events.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/codeact/prompts.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/common/default.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/common/events.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/agent_persona.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/context_injection_manager.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/episodic_memory.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/personas/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/personas/app_starter.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/personas/big_agent.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/personas/default.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/personas/ui_expert.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/context/reflection.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/droid/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/oneflows/reflector.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/planner/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/planner/events.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/planner/prompts.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/utils/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/utils/async_utils.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/utils/llm_picker.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/agent/utils/trajectory.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/cli/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/cli/logs.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/macro/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/macro/__main__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/macro/replay.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/telemetry/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/telemetry/tracker.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/tools/__init__.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/droidrun/tools/ios.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/gen-docs-sdk-ref.sh +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/setup.py +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/static/droidrun-dark.png +0 -0
- {droidrun-0.3.3 → droidrun-0.3.5}/static/droidrun.png +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: droidrun
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.5
|
4
4
|
Summary: A framework for controlling Android devices through LLM agents
|
5
5
|
Project-URL: Homepage, https://github.com/droidrun/droidrun
|
6
6
|
Project-URL: Bug Tracker, https://github.com/droidrun/droidrun/issues
|
@@ -46,7 +46,6 @@ Requires-Dist: posthog==6.0.2
|
|
46
46
|
Requires-Dist: pydantic>=2.0.0
|
47
47
|
Requires-Dist: python-dotenv>=1.0.0
|
48
48
|
Requires-Dist: rich>=13.0.0
|
49
|
-
Requires-Dist: typing-extensions
|
50
49
|
Provides-Extra: dev
|
51
50
|
Requires-Dist: bandit>=1.7.0; extra == 'dev'
|
52
51
|
Requires-Dist: black>=23.0.0; extra == 'dev'
|
@@ -14,7 +14,7 @@
|
|
14
14
|
"tab": "Framework",
|
15
15
|
"versions": [
|
16
16
|
{
|
17
|
-
"version": "0.3.
|
17
|
+
"version": "0.3.3",
|
18
18
|
"groups": [
|
19
19
|
{
|
20
20
|
"group": "Introduction",
|
@@ -49,8 +49,7 @@
|
|
49
49
|
"v3/sdk/droid-agent",
|
50
50
|
"v3/sdk/adb-tools",
|
51
51
|
"v3/sdk/ios-tools",
|
52
|
-
"v3/sdk/base-tools"
|
53
|
-
"v3/sdk/adb-utils"
|
52
|
+
"v3/sdk/base-tools"
|
54
53
|
]
|
55
54
|
}
|
56
55
|
]
|
@@ -21,7 +21,7 @@ def __init__(
|
|
21
21
|
reflection: bool = False, # Enable reflection
|
22
22
|
enable_tracing: bool = False, # Enable tracing (this requires arize phoenix)
|
23
23
|
debug: bool = False, # Enable additional debug logs
|
24
|
-
save_trajectories:
|
24
|
+
save_trajectories: str = "none", # Trajectory saving level: "none" (no saving), "step" (save per step), "action" (save per action)
|
25
25
|
*args,
|
26
26
|
**kwargs
|
27
27
|
)
|
@@ -92,6 +92,7 @@ agent = DroidAgent(
|
|
92
92
|
reflection=True
|
93
93
|
)
|
94
94
|
```
|
95
|
+
<Warning>Reflection is based on screenshots. Use it alongside an LLM model with vision capabilities (e.g., GPT-4o, Gemini-2.5-Flash etc.).</Warning>
|
95
96
|
**Flow:** Goal → Planning → Execution → Reflection → Re-planning (if needed) → Result
|
96
97
|
|
97
98
|
**Best Practice:**
|
@@ -61,12 +61,14 @@ from droidrun import DroidAgent, AdbTools
|
|
61
61
|
|
62
62
|
async def main():
|
63
63
|
# load adb tools for the first connected device
|
64
|
-
tools =
|
64
|
+
tools = AdbTools()
|
65
65
|
|
66
66
|
# Set up the Ollama LLM with a modern model
|
67
67
|
llm = Ollama(
|
68
|
-
model="qwen2.5vl",
|
69
|
-
base_url="http://localhost:11434" # default Ollama endpoint
|
68
|
+
model="qwen2.5vl", # or "gemma3", "deepseek", "llama4", etc.
|
69
|
+
base_url="http://localhost:11434", # default Ollama endpoint
|
70
|
+
context_window=8192, # limit the max context window to prevent running out of memory.
|
71
|
+
request_timeout=120.0 # increase the request timeout
|
70
72
|
)
|
71
73
|
|
72
74
|
# Create the DroidAgent
|
@@ -74,7 +76,7 @@ async def main():
|
|
74
76
|
goal="Open Settings and check battery level",
|
75
77
|
llm=llm,
|
76
78
|
tools=tools,
|
77
|
-
vision=
|
79
|
+
vision=False, # Optional: enable vision. use vision=True only in conjunction with a vision model
|
78
80
|
reasoning=True, # Optional: enable planning/reasoning. Read more about the agent configuration in Core-Concepts/Agent
|
79
81
|
)
|
80
82
|
|
@@ -88,6 +90,8 @@ if __name__ == "__main__":
|
|
88
90
|
asyncio.run(main())
|
89
91
|
```
|
90
92
|
|
93
|
+
<Note>Limiting the llm's context_window reduces memory usage, but degrades the agent's performance too. For the best results try extending it as much as possible.</Note>
|
94
|
+
|
91
95
|
## 4. Troubleshooting
|
92
96
|
|
93
97
|
- **Ollama not running:** Make sure `ollama serve` is running and accessible at `http://localhost:11434`.
|
@@ -50,7 +50,7 @@ from droidrun import DroidAgent, AdbTools
|
|
50
50
|
|
51
51
|
async def main():
|
52
52
|
# Load adb tools for the first connected device
|
53
|
-
tools =
|
53
|
+
tools = AdbTools()
|
54
54
|
|
55
55
|
# Set up the OpenAI-like LLM (uses env vars for API key and base by default)
|
56
56
|
llm = OpenAILike(
|
@@ -59,7 +59,7 @@ from llama_index.llms.google_genai import GoogleGenAI
|
|
59
59
|
|
60
60
|
async def main():
|
61
61
|
# Load tools
|
62
|
-
tools =
|
62
|
+
tools = AdbTools()
|
63
63
|
# set up google gemini llm
|
64
64
|
llm = GoogleGenAI(
|
65
65
|
api_key="YOUR_GEMINI_API_KEY", # Replace with your Gemini API key
|
@@ -19,7 +19,11 @@ Core UI interaction tools for Android device control.
|
|
19
19
|
#### AdbTools.\_\_init\_\_
|
20
20
|
|
21
21
|
```python
|
22
|
-
def __init__(
|
22
|
+
def __init__(
|
23
|
+
serial: str | None = None,
|
24
|
+
use_tcp: bool = False,
|
25
|
+
tcp_port: int = 8080
|
26
|
+
) -> None
|
23
27
|
```
|
24
28
|
|
25
29
|
Initialize the AdbTools instance.
|
@@ -27,32 +31,53 @@ Initialize the AdbTools instance.
|
|
27
31
|
**Arguments**:
|
28
32
|
|
29
33
|
- `serial` - Device serial number
|
34
|
+
- `use_tcp` - Whether to use TCP communication (default: False)
|
35
|
+
- `tcp_port` - TCP port for communication (default: 8080)
|
30
36
|
|
31
|
-
<a id="droidrun.tools.adb.AdbTools.
|
37
|
+
<a id="droidrun.tools.adb.AdbTools.setup_tcp_forward"></a>
|
32
38
|
|
33
|
-
#### AdbTools.
|
39
|
+
#### AdbTools.setup\_tcp\_forward
|
34
40
|
|
35
41
|
```python
|
36
|
-
|
42
|
+
def setup_tcp_forward() -> bool
|
37
43
|
```
|
38
44
|
|
39
|
-
|
45
|
+
Set up ADB TCP port forwarding for communication with the portal app.
|
40
46
|
|
41
|
-
**
|
47
|
+
**Returns**:
|
42
48
|
|
43
|
-
- `
|
44
|
-
|
49
|
+
- `bool` - True if forwarding was set up successfully, False otherwise
|
50
|
+
|
51
|
+
<a id="droidrun.tools.adb.AdbTools.teardown_tcp_forward"></a>
|
52
|
+
|
53
|
+
#### AdbTools.teardown\_tcp\_forward
|
54
|
+
|
55
|
+
```python
|
56
|
+
def teardown_tcp_forward() -> bool
|
57
|
+
```
|
58
|
+
|
59
|
+
Remove ADB TCP port forwarding.
|
45
60
|
|
46
61
|
**Returns**:
|
47
62
|
|
48
|
-
|
63
|
+
- `bool` - True if forwarding was removed successfully, False otherwise
|
64
|
+
|
65
|
+
<a id="droidrun.tools.adb.AdbTools.__del__"></a>
|
66
|
+
|
67
|
+
#### AdbTools.\_\_del\_\_
|
68
|
+
|
69
|
+
```python
|
70
|
+
def __del__()
|
71
|
+
```
|
72
|
+
|
73
|
+
Cleanup when the object is destroyed.
|
49
74
|
|
50
75
|
<a id="droidrun.tools.adb.AdbTools.tap_by_index"></a>
|
51
76
|
|
52
77
|
#### AdbTools.tap\_by\_index
|
53
78
|
|
54
79
|
```python
|
55
|
-
|
80
|
+
def tap_by_index(index: int) -> str
|
56
81
|
```
|
57
82
|
|
58
83
|
Tap on a UI element by its index.
|
@@ -74,7 +99,7 @@ to find the element with the given index and tap on its center coordinates.
|
|
74
99
|
#### AdbTools.tap\_by\_coordinates
|
75
100
|
|
76
101
|
```python
|
77
|
-
|
102
|
+
def tap_by_coordinates(x: int, y: int) -> bool
|
78
103
|
```
|
79
104
|
|
80
105
|
Tap on the device screen at specific coordinates.
|
@@ -94,7 +119,7 @@ Tap on the device screen at specific coordinates.
|
|
94
119
|
#### AdbTools.tap
|
95
120
|
|
96
121
|
```python
|
97
|
-
|
122
|
+
def tap(index: int) -> str
|
98
123
|
```
|
99
124
|
|
100
125
|
Tap on a UI element by its index.
|
@@ -116,12 +141,12 @@ to find the element with the given index and tap on its center coordinates.
|
|
116
141
|
#### AdbTools.swipe
|
117
142
|
|
118
143
|
```python
|
119
|
-
|
144
|
+
def swipe(
|
120
145
|
start_x: int,
|
121
146
|
start_y: int,
|
122
147
|
end_x: int,
|
123
148
|
end_y: int,
|
124
|
-
duration_ms:
|
149
|
+
duration_ms: float = 300
|
125
150
|
) -> bool
|
126
151
|
```
|
127
152
|
|
@@ -134,7 +159,35 @@ To perform a hold (long press), set the start and end coordinates to the same va
|
|
134
159
|
- `start_y` - Starting Y coordinate
|
135
160
|
- `end_x` - Ending X coordinate
|
136
161
|
- `end_y` - Ending Y coordinate
|
137
|
-
- `
|
162
|
+
- `duration` - Duration of swipe in seconds
|
163
|
+
|
164
|
+
**Returns**:
|
165
|
+
|
166
|
+
Bool indicating success or failure
|
167
|
+
|
168
|
+
<a id="droidrun.tools.adb.AdbTools.drag"></a>
|
169
|
+
|
170
|
+
#### AdbTools.drag
|
171
|
+
|
172
|
+
```python
|
173
|
+
def drag(
|
174
|
+
start_x: int,
|
175
|
+
start_y: int,
|
176
|
+
end_x: int,
|
177
|
+
end_y: int,
|
178
|
+
duration: float = 3
|
179
|
+
) -> bool
|
180
|
+
```
|
181
|
+
|
182
|
+
Performs a straight-line drag and drop gesture on the device screen.
|
183
|
+
|
184
|
+
**Arguments**:
|
185
|
+
|
186
|
+
- `start_x` - Starting X coordinate
|
187
|
+
- `start_y` - Starting Y coordinate
|
188
|
+
- `end_x` - Ending X coordinate
|
189
|
+
- `end_y` - Ending Y coordinate
|
190
|
+
- `duration` - Duration of swipe in seconds
|
138
191
|
|
139
192
|
**Returns**:
|
140
193
|
|
@@ -145,7 +198,7 @@ To perform a hold (long press), set the start and end coordinates to the same va
|
|
145
198
|
#### AdbTools.input\_text
|
146
199
|
|
147
200
|
```python
|
148
|
-
|
201
|
+
def input_text(text: str) -> str
|
149
202
|
```
|
150
203
|
|
151
204
|
Input text on the device.
|
@@ -165,7 +218,7 @@ Always make sure that the Focused Element is not None before inputting text.
|
|
165
218
|
#### AdbTools.back
|
166
219
|
|
167
220
|
```python
|
168
|
-
|
221
|
+
def back() -> str
|
169
222
|
```
|
170
223
|
|
171
224
|
Go back on the current view.
|
@@ -176,7 +229,7 @@ This presses the Android back button.
|
|
176
229
|
#### AdbTools.press\_key
|
177
230
|
|
178
231
|
```python
|
179
|
-
|
232
|
+
def press_key(keycode: int) -> str
|
180
233
|
```
|
181
234
|
|
182
235
|
Press a key on the Android device.
|
@@ -196,7 +249,7 @@ Common keycodes:
|
|
196
249
|
#### AdbTools.start\_app
|
197
250
|
|
198
251
|
```python
|
199
|
-
|
252
|
+
def start_app(package: str, activity: str | None = None) -> str
|
200
253
|
```
|
201
254
|
|
202
255
|
Start an app on the device.
|
@@ -211,7 +264,7 @@ Start an app on the device.
|
|
211
264
|
#### AdbTools.install\_app
|
212
265
|
|
213
266
|
```python
|
214
|
-
|
267
|
+
def install_app(
|
215
268
|
apk_path: str,
|
216
269
|
reinstall: bool = False,
|
217
270
|
grant_permissions: bool = True
|
@@ -231,7 +284,7 @@ Install an app on the device.
|
|
231
284
|
#### AdbTools.take\_screenshot
|
232
285
|
|
233
286
|
```python
|
234
|
-
|
287
|
+
def take_screenshot() -> Tuple[str, bytes]
|
235
288
|
```
|
236
289
|
|
237
290
|
Take a screenshot of the device.
|
@@ -243,7 +296,7 @@ Also stores the screenshot in the screenshots list with timestamp for later GIF
|
|
243
296
|
#### AdbTools.list\_packages
|
244
297
|
|
245
298
|
```python
|
246
|
-
|
299
|
+
def list_packages(include_system_apps: bool = False) -> List[str]
|
247
300
|
```
|
248
301
|
|
249
302
|
List installed packages on the device.
|
@@ -277,7 +330,7 @@ Mark the task as finished.
|
|
277
330
|
#### AdbTools.remember
|
278
331
|
|
279
332
|
```python
|
280
|
-
|
333
|
+
def remember(information: str) -> str
|
281
334
|
```
|
282
335
|
|
283
336
|
Store important information to remember for future context.
|
@@ -314,7 +367,7 @@ Retrieve all stored memory items.
|
|
314
367
|
#### AdbTools.get\_state
|
315
368
|
|
316
369
|
```python
|
317
|
-
|
370
|
+
def get_state(serial: Optional[str] = None) -> Dict[str, Any]
|
318
371
|
```
|
319
372
|
|
320
373
|
Get both the a11y tree and phone state in a single call using the combined /state endpoint.
|
@@ -328,3 +381,45 @@ Get both the a11y tree and phone state in a single call using the combined /stat
|
|
328
381
|
|
329
382
|
Dictionary containing both 'a11y_tree' and 'phone_state' data
|
330
383
|
|
384
|
+
<a id="droidrun.tools.adb.AdbTools.get_a11y_tree"></a>
|
385
|
+
|
386
|
+
#### AdbTools.get\_a11y\_tree
|
387
|
+
|
388
|
+
```python
|
389
|
+
def get_a11y_tree() -> Dict[str, Any]
|
390
|
+
```
|
391
|
+
|
392
|
+
Get just the accessibility tree using the /a11y_tree endpoint.
|
393
|
+
|
394
|
+
**Returns**:
|
395
|
+
|
396
|
+
Dictionary containing accessibility tree data
|
397
|
+
|
398
|
+
<a id="droidrun.tools.adb.AdbTools.get_phone_state"></a>
|
399
|
+
|
400
|
+
#### AdbTools.get\_phone\_state
|
401
|
+
|
402
|
+
```python
|
403
|
+
def get_phone_state() -> Dict[str, Any]
|
404
|
+
```
|
405
|
+
|
406
|
+
Get just the phone state using the /phone_state endpoint.
|
407
|
+
|
408
|
+
**Returns**:
|
409
|
+
|
410
|
+
Dictionary containing phone state data
|
411
|
+
|
412
|
+
<a id="droidrun.tools.adb.AdbTools.ping"></a>
|
413
|
+
|
414
|
+
#### AdbTools.ping
|
415
|
+
|
416
|
+
```python
|
417
|
+
def ping() -> Dict[str, Any]
|
418
|
+
```
|
419
|
+
|
420
|
+
Test the TCP connection using the /ping endpoint.
|
421
|
+
|
422
|
+
**Returns**:
|
423
|
+
|
424
|
+
Dictionary with ping result
|
425
|
+
|
@@ -13,12 +13,23 @@ class Tools(ABC)
|
|
13
13
|
Abstract base class for all tools.
|
14
14
|
This class provides a common interface for all tools to implement.
|
15
15
|
|
16
|
+
<a id="droidrun.tools.tools.Tools.ui_action"></a>
|
17
|
+
|
18
|
+
#### Tools.ui\_action
|
19
|
+
|
20
|
+
```python
|
21
|
+
def ui_action(func)
|
22
|
+
```
|
23
|
+
|
24
|
+
"
|
25
|
+
Decorator to capture screenshots and UI states for actions that modify the UI.
|
26
|
+
|
16
27
|
<a id="droidrun.tools.tools.Tools.get_state"></a>
|
17
28
|
|
18
29
|
#### Tools.get\_state
|
19
30
|
|
20
31
|
```python
|
21
|
-
|
32
|
+
def get_state() -> Dict[str, Any]
|
22
33
|
```
|
23
34
|
|
24
35
|
Get the current state of the tool.
|
@@ -28,7 +39,7 @@ Get the current state of the tool.
|
|
28
39
|
#### Tools.tap\_by\_index
|
29
40
|
|
30
41
|
```python
|
31
|
-
|
42
|
+
def tap_by_index(index: int) -> str
|
32
43
|
```
|
33
44
|
|
34
45
|
Tap the element at the given index.
|
@@ -38,7 +49,7 @@ Tap the element at the given index.
|
|
38
49
|
#### Tools.swipe
|
39
50
|
|
40
51
|
```python
|
41
|
-
|
52
|
+
def swipe(
|
42
53
|
start_x: int,
|
43
54
|
start_y: int,
|
44
55
|
end_x: int,
|
@@ -49,12 +60,28 @@ async def swipe(
|
|
49
60
|
|
50
61
|
Swipe from the given start coordinates to the given end coordinates.
|
51
62
|
|
63
|
+
<a id="droidrun.tools.tools.Tools.drag"></a>
|
64
|
+
|
65
|
+
#### Tools.drag
|
66
|
+
|
67
|
+
```python
|
68
|
+
def drag(
|
69
|
+
start_x: int,
|
70
|
+
start_y: int,
|
71
|
+
end_x: int,
|
72
|
+
end_y: int,
|
73
|
+
duration_ms: int = 3000
|
74
|
+
) -> bool
|
75
|
+
```
|
76
|
+
|
77
|
+
Drag from the given start coordinates to the given end coordinates.
|
78
|
+
|
52
79
|
<a id="droidrun.tools.tools.Tools.input_text"></a>
|
53
80
|
|
54
81
|
#### Tools.input\_text
|
55
82
|
|
56
83
|
```python
|
57
|
-
|
84
|
+
def input_text(text: str) -> str
|
58
85
|
```
|
59
86
|
|
60
87
|
Input the given text into a focused input field.
|
@@ -64,7 +91,7 @@ Input the given text into a focused input field.
|
|
64
91
|
#### Tools.back
|
65
92
|
|
66
93
|
```python
|
67
|
-
|
94
|
+
def back() -> str
|
68
95
|
```
|
69
96
|
|
70
97
|
Press the back button.
|
@@ -74,7 +101,7 @@ Press the back button.
|
|
74
101
|
#### Tools.press\_key
|
75
102
|
|
76
103
|
```python
|
77
|
-
|
104
|
+
def press_key(keycode: int) -> str
|
78
105
|
```
|
79
106
|
|
80
107
|
Enter the given keycode.
|
@@ -84,7 +111,7 @@ Enter the given keycode.
|
|
84
111
|
#### Tools.start\_app
|
85
112
|
|
86
113
|
```python
|
87
|
-
|
114
|
+
def start_app(package: str, activity: str = "") -> str
|
88
115
|
```
|
89
116
|
|
90
117
|
Start the given app.
|
@@ -94,7 +121,7 @@ Start the given app.
|
|
94
121
|
#### Tools.take\_screenshot
|
95
122
|
|
96
123
|
```python
|
97
|
-
|
124
|
+
def take_screenshot() -> Tuple[str, bytes]
|
98
125
|
```
|
99
126
|
|
100
127
|
Take a screenshot of the device.
|
@@ -104,7 +131,7 @@ Take a screenshot of the device.
|
|
104
131
|
#### Tools.list\_packages
|
105
132
|
|
106
133
|
```python
|
107
|
-
|
134
|
+
def list_packages(include_system_apps: bool = False) -> List[str]
|
108
135
|
```
|
109
136
|
|
110
137
|
List all packages on the device.
|
@@ -114,7 +141,7 @@ List all packages on the device.
|
|
114
141
|
#### Tools.remember
|
115
142
|
|
116
143
|
```python
|
117
|
-
|
144
|
+
def remember(information: str) -> str
|
118
145
|
```
|
119
146
|
|
120
147
|
Remember the given information. This is used to store information in the tool's memory.
|
@@ -124,7 +151,7 @@ Remember the given information. This is used to store information in the tool's
|
|
124
151
|
#### Tools.get\_memory
|
125
152
|
|
126
153
|
```python
|
127
|
-
|
154
|
+
def get_memory() -> List[str]
|
128
155
|
```
|
129
156
|
|
130
157
|
Get the memory of the tool.
|
@@ -134,7 +161,7 @@ Get the memory of the tool.
|
|
134
161
|
#### Tools.complete
|
135
162
|
|
136
163
|
```python
|
137
|
-
def complete(success: bool, reason: str = "") ->
|
164
|
+
def complete(success: bool, reason: str = "") -> None
|
138
165
|
```
|
139
166
|
|
140
167
|
Complete the tool. This is used to indicate that the tool has completed its task.
|
@@ -144,7 +171,10 @@ Complete the tool. This is used to indicate that the tool has completed its task
|
|
144
171
|
#### describe\_tools
|
145
172
|
|
146
173
|
```python
|
147
|
-
def describe_tools(
|
174
|
+
def describe_tools(
|
175
|
+
tools: Tools,
|
176
|
+
exclude_tools: Optional[List[str]] = None
|
177
|
+
) -> Dict[str, Callable[..., Any]]
|
148
178
|
```
|
149
179
|
|
150
180
|
Describe the tools available for the given Tools instance.
|
@@ -152,6 +182,7 @@ Describe the tools available for the given Tools instance.
|
|
152
182
|
**Arguments**:
|
153
183
|
|
154
184
|
- `tools` - The Tools instance to describe.
|
185
|
+
- `exclude_tools` - List of tool names to exclude from the description.
|
155
186
|
|
156
187
|
|
157
188
|
**Returns**:
|
@@ -33,7 +33,8 @@ def __init__(
|
|
33
33
|
reflection: bool = False,
|
34
34
|
enable_tracing: bool = False,
|
35
35
|
debug: bool = False,
|
36
|
-
save_trajectories:
|
36
|
+
save_trajectories: str = "none",
|
37
|
+
excluded_tools: List[str] = None,
|
37
38
|
*args,
|
38
39
|
**kwargs
|
39
40
|
)
|
@@ -52,6 +53,10 @@ Initialize the DroidAgent wrapper.
|
|
52
53
|
- `reflection` - Whether to reflect on steps the CodeActAgent did to give the PlannerAgent advice
|
53
54
|
- `enable_tracing` - Whether to enable Arize Phoenix tracing
|
54
55
|
- `debug` - Whether to enable verbose debug logging
|
56
|
+
- `save_trajectories` - Trajectory saving level. Can be:
|
57
|
+
- "none" (no saving)
|
58
|
+
- "step" (save per step)
|
59
|
+
- "action" (save per action)
|
55
60
|
- `**kwargs` - Additional keyword arguments to pass to the agents
|
56
61
|
|
57
62
|
<a id="droidrun.agent.droid.droid_agent.DroidAgent.run"></a>
|
@@ -59,7 +64,7 @@ Initialize the DroidAgent wrapper.
|
|
59
64
|
#### DroidAgent.run
|
60
65
|
|
61
66
|
```python
|
62
|
-
def run() -> WorkflowHandler
|
67
|
+
def run(*args, **kwargs) -> WorkflowHandler
|
63
68
|
```
|
64
69
|
|
65
70
|
Run the DroidAgent workflow.
|