droidrun 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl
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/__init__.py +1 -10
- droidrun/adb/device.py +101 -71
- droidrun/adb/manager.py +3 -3
- droidrun/agent/codeact/codeact_agent.py +22 -12
- droidrun/agent/context/personas/__init__.py +0 -2
- droidrun/agent/context/personas/default.py +1 -1
- droidrun/agent/droid/droid_agent.py +56 -8
- droidrun/agent/droid/events.py +4 -0
- droidrun/agent/planner/planner_agent.py +32 -12
- droidrun/agent/utils/chat_utils.py +4 -7
- droidrun/agent/utils/llm_picker.py +1 -0
- droidrun/cli/main.py +163 -78
- droidrun/portal.py +139 -0
- droidrun/telemetry/__init__.py +4 -0
- droidrun/telemetry/events.py +27 -0
- droidrun/telemetry/tracker.py +83 -0
- droidrun/tools/adb.py +199 -407
- droidrun/tools/ios.py +10 -5
- droidrun/tools/tools.py +42 -11
- {droidrun-0.3.0.dist-info → droidrun-0.3.2.dist-info}/METADATA +19 -29
- {droidrun-0.3.0.dist-info → droidrun-0.3.2.dist-info}/RECORD +24 -23
- droidrun/agent/context/personas/extractor.py +0 -52
- droidrun/agent/context/todo.txt +0 -4
- droidrun/run.py +0 -105
- {droidrun-0.3.0.dist-info → droidrun-0.3.2.dist-info}/WHEEL +0 -0
- {droidrun-0.3.0.dist-info → droidrun-0.3.2.dist-info}/entry_points.txt +0 -0
- {droidrun-0.3.0.dist-info → droidrun-0.3.2.dist-info}/licenses/LICENSE +0 -0
droidrun/tools/ios.py
CHANGED
@@ -39,6 +39,12 @@ class IOSTools(Tools):
|
|
39
39
|
"""Core UI interaction tools for iOS device control."""
|
40
40
|
|
41
41
|
def __init__(self, url: str, bundle_identifiers: List[str] = []) -> None:
|
42
|
+
"""Initialize the IOSTools instance.
|
43
|
+
|
44
|
+
Args:
|
45
|
+
url: iOS device URL. This is the URL of the iOS device. It is used to send requests to the iOS device.
|
46
|
+
bundle_identifiers: List of bundle identifiers to include in the list of packages
|
47
|
+
"""
|
42
48
|
self.clickable_elements_cache: List[Dict[str, Any]] = []
|
43
49
|
self.url = url
|
44
50
|
self.last_screenshot = None
|
@@ -53,7 +59,7 @@ class IOSTools(Tools):
|
|
53
59
|
self.bundle_identifiers = bundle_identifiers
|
54
60
|
logger.info(f"iOS device URL: {url}")
|
55
61
|
|
56
|
-
async def
|
62
|
+
async def get_state(
|
57
63
|
self, serial: Optional[str] = None
|
58
64
|
) -> List[Dict[str, Any]]:
|
59
65
|
"""
|
@@ -80,7 +86,9 @@ class IOSTools(Tools):
|
|
80
86
|
# Cache the elements for tap_by_index usage
|
81
87
|
self.clickable_elements_cache = elements
|
82
88
|
|
83
|
-
return
|
89
|
+
return {
|
90
|
+
"a11y_tree":self.clickable_elements_cache
|
91
|
+
}
|
84
92
|
else:
|
85
93
|
logger.error(
|
86
94
|
f"Failed to get accessibility data: HTTP {response.status}"
|
@@ -534,9 +542,6 @@ class IOSTools(Tools):
|
|
534
542
|
all_packages.update(SYSTEM_BUNDLE_IDENTIFIERS)
|
535
543
|
return sorted(list(all_packages))
|
536
544
|
|
537
|
-
async def extract(self, filename: str | None = None) -> str:
|
538
|
-
# TODO
|
539
|
-
return "not implemented"
|
540
545
|
|
541
546
|
async def remember(self, information: str) -> str:
|
542
547
|
"""
|
droidrun/tools/tools.py
CHANGED
@@ -8,12 +8,23 @@ logger = logging.getLogger(__name__)
|
|
8
8
|
|
9
9
|
|
10
10
|
class Tools(ABC):
|
11
|
+
"""
|
12
|
+
Abstract base class for all tools.
|
13
|
+
This class provides a common interface for all tools to implement.
|
14
|
+
"""
|
15
|
+
|
11
16
|
@abstractmethod
|
12
|
-
async def
|
17
|
+
async def get_state(self) -> Dict[str, Any]:
|
18
|
+
"""
|
19
|
+
Get the current state of the tool.
|
20
|
+
"""
|
13
21
|
pass
|
14
22
|
|
15
23
|
@abstractmethod
|
16
24
|
async def tap_by_index(self, index: int) -> bool:
|
25
|
+
"""
|
26
|
+
Tap the element at the given index.
|
27
|
+
"""
|
17
28
|
pass
|
18
29
|
|
19
30
|
#@abstractmethod
|
@@ -24,50 +35,72 @@ class Tools(ABC):
|
|
24
35
|
async def swipe(
|
25
36
|
self, start_x: int, start_y: int, end_x: int, end_y: int, duration_ms: int = 300
|
26
37
|
) -> bool:
|
38
|
+
"""
|
39
|
+
Swipe from the given start coordinates to the given end coordinates.
|
40
|
+
"""
|
27
41
|
pass
|
28
42
|
|
29
43
|
@abstractmethod
|
30
44
|
async def input_text(self, text: str) -> bool:
|
45
|
+
"""
|
46
|
+
Input the given text into a focused input field.
|
47
|
+
"""
|
31
48
|
pass
|
32
49
|
|
33
50
|
@abstractmethod
|
34
51
|
async def back(self) -> bool:
|
52
|
+
"""
|
53
|
+
Press the back button.
|
54
|
+
"""
|
35
55
|
pass
|
36
56
|
|
37
57
|
@abstractmethod
|
38
58
|
async def press_key(self, keycode: int) -> bool:
|
59
|
+
"""
|
60
|
+
Enter the given keycode.
|
61
|
+
"""
|
39
62
|
pass
|
40
63
|
|
41
64
|
@abstractmethod
|
42
65
|
async def start_app(self, package: str, activity: str = "") -> bool:
|
66
|
+
"""
|
67
|
+
Start the given app.
|
68
|
+
"""
|
43
69
|
pass
|
44
70
|
|
45
71
|
@abstractmethod
|
46
72
|
async def take_screenshot(self) -> Tuple[str, bytes]:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
async def get_phone_state(self) -> Dict[str, Any]:
|
73
|
+
"""
|
74
|
+
Take a screenshot of the device.
|
75
|
+
"""
|
51
76
|
pass
|
52
77
|
|
53
78
|
@abstractmethod
|
54
79
|
async def list_packages(self, include_system_apps: bool = False) -> List[str]:
|
80
|
+
"""
|
81
|
+
List all packages on the device.
|
82
|
+
"""
|
55
83
|
pass
|
56
84
|
|
57
85
|
@abstractmethod
|
58
86
|
async def remember(self, information: str) -> str:
|
87
|
+
"""
|
88
|
+
Remember the given information. This is used to store information in the tool's memory.
|
89
|
+
"""
|
59
90
|
pass
|
60
91
|
|
61
92
|
@abstractmethod
|
62
93
|
async def get_memory(self) -> List[str]:
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
async def extract(self, filename: Optional[str] = None) -> str:
|
94
|
+
"""
|
95
|
+
Get the memory of the tool.
|
96
|
+
"""
|
67
97
|
pass
|
68
98
|
|
69
99
|
@abstractmethod
|
70
100
|
def complete(self, success: bool, reason: str = "") -> bool:
|
101
|
+
"""
|
102
|
+
Complete the tool. This is used to indicate that the tool has completed its task.
|
103
|
+
"""
|
71
104
|
pass
|
72
105
|
|
73
106
|
|
@@ -88,12 +121,10 @@ def describe_tools(tools: Tools) -> Dict[str, Callable[..., Any]]:
|
|
88
121
|
"input_text": tools.input_text,
|
89
122
|
"press_key": tools.press_key,
|
90
123
|
"tap_by_index": tools.tap_by_index,
|
91
|
-
# "tap_by_coordinates": tools_instance.tap_by_coordinates,
|
92
124
|
# App management
|
93
125
|
"start_app": tools.start_app,
|
94
126
|
"list_packages": tools.list_packages,
|
95
127
|
# state management
|
96
|
-
"extract": tools.extract,
|
97
128
|
"remember": tools.remember,
|
98
129
|
"complete": tools.complete,
|
99
130
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: droidrun
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.2
|
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
|
@@ -34,11 +34,13 @@ Requires-Dist: llama-index
|
|
34
34
|
Requires-Dist: llama-index-callbacks-arize-phoenix
|
35
35
|
Requires-Dist: llama-index-llms-anthropic
|
36
36
|
Requires-Dist: llama-index-llms-deepseek
|
37
|
-
Requires-Dist: llama-index-llms-
|
37
|
+
Requires-Dist: llama-index-llms-google-genai
|
38
38
|
Requires-Dist: llama-index-llms-ollama
|
39
39
|
Requires-Dist: llama-index-llms-openai
|
40
|
+
Requires-Dist: llama-index-llms-openai-like
|
40
41
|
Requires-Dist: openai>=1.0.0
|
41
42
|
Requires-Dist: pillow>=10.0.0
|
43
|
+
Requires-Dist: posthog==6.0.2
|
42
44
|
Requires-Dist: pydantic>=2.0.0
|
43
45
|
Requires-Dist: python-dotenv>=1.0.0
|
44
46
|
Requires-Dist: rich>=13.0.0
|
@@ -66,6 +68,8 @@ Description-Content-Type: text/markdown
|
|
66
68
|
|
67
69
|
DroidRun is a powerful framework for controlling Android and iOS devices through LLM agents. It allows you to automate device interactions using natural language commands. [Checkout our benchmark results](https://droidrun.ai/benchmark)
|
68
70
|
|
71
|
+
## Why Droidrun?
|
72
|
+
|
69
73
|
- 🤖 Control Android and iOS devices with natural language commands
|
70
74
|
- 🔀 Supports multiple LLM providers (OpenAI, Anthropic, Gemini, Ollama, DeepSeek)
|
71
75
|
- 🧠 Planning capabilities for complex multi-step tasks
|
@@ -81,22 +85,24 @@ pip install droidrun
|
|
81
85
|
```
|
82
86
|
|
83
87
|
## 🚀 Quickstart
|
84
|
-
Read on how to get droidrun up and running within seconds in [our docs](https://docs.droidrun.ai/v3/quickstart)!
|
88
|
+
Read on how to get droidrun up and running within seconds in [our docs](https://docs.droidrun.ai/v3/quickstart)!
|
85
89
|
|
90
|
+
[](https://www.youtube.com/watch?v=4WT7FXJah2I)
|
86
91
|
|
87
92
|
## 🎬 Demo Videos
|
88
93
|
|
89
|
-
1. **
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
+
1. **Group Chat Summarization**: Let DroidRun summarize an escalated group chat for you.
|
95
|
+
|
96
|
+
[](https://www.youtube.com/watch?v=ofEnSUHHxX8)
|
97
|
+
|
98
|
+
2. **Travel Search Assistant**: Wittness DroidRun looking for the cheapest stay and share it with a colleague on telegram.
|
99
|
+
|
100
|
+
[](https://www.youtube.com/watch?v=QgtRaLS3NBM)
|
101
|
+
|
102
|
+
3. **Automate TikTok Shopping**: See how DroidRun looks for a stanley cup on TikTok Shop and send the product details via email.
|
103
|
+
|
104
|
+
[](https://www.youtube.com/watch?v=ol3bivBAmn4)
|
94
105
|
|
95
|
-
2. **Social Media Automation**: See DroidRun open X (Twitter) and post "Hello World".
|
96
|
-
|
97
|
-
Prompt: "Open up X and post Hello World."
|
98
|
-
|
99
|
-
[](https://www.youtube.com/watch?v=i4-sDQhzt_M)
|
100
106
|
|
101
107
|
## 💡 Example Use Cases
|
102
108
|
|
@@ -106,22 +112,6 @@ Read on how to get droidrun up and running within seconds in [our docs](https://
|
|
106
112
|
- Remote assistance for less technical users
|
107
113
|
- Exploring mobile UI with natural language commands
|
108
114
|
|
109
|
-
## 🗺️ Roadmap
|
110
|
-
|
111
|
-
### 🤖 Agent:
|
112
|
-
- **Improve memory**: Enhance context retention for complex multi-step tasks
|
113
|
-
- **Expand planning capabilities**: Add support for more complex reasoning strategies
|
114
|
-
- **Add Integrations**: Support more LLM providers and agent frameworks (LangChain, Agno etc.)
|
115
|
-
|
116
|
-
### ⚙️ Automations:
|
117
|
-
- **Create Automation Scripts**: Generate reusable scripts from agent actions that can be scheduled or shared
|
118
|
-
|
119
|
-
### ☁️ Cloud:
|
120
|
-
- **Hosted version**: Remote device control via web interface without local setup
|
121
|
-
- **Add-Ons**: Marketplace for extensions serving specific use cases
|
122
|
-
- **Proxy Hours**: Cloud compute time with tiered pricing for running automations
|
123
|
-
- **Droidrun AppStore**: Simple installation of Apps on your hosted devices
|
124
|
-
|
125
115
|
## 👥 Contributing
|
126
116
|
|
127
117
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
@@ -1,13 +1,13 @@
|
|
1
|
-
droidrun/__init__.py,sha256=
|
1
|
+
droidrun/__init__.py,sha256=OqgWoczsC4gpt40pV-wuw7x5DQmmbKtNSxQ8QqPEY1E,510
|
2
2
|
droidrun/__main__.py,sha256=78o1Wr_Z-NrZy9yLWmEfNfRRhAiJGBr4Xi3lmbgkx3w,105
|
3
|
-
droidrun/
|
3
|
+
droidrun/portal.py,sha256=4UEoTdAg6TWgxCXEhyAXMARr8Hsq5wLDx_4zim9-eaA,4061
|
4
4
|
droidrun/adb/__init__.py,sha256=kh-iT9Sv6RZ2dFSDu1beK_GgtAq8wlMvZQ7puR8JWsI,257
|
5
|
-
droidrun/adb/device.py,sha256=
|
6
|
-
droidrun/adb/manager.py,sha256=
|
5
|
+
droidrun/adb/device.py,sha256=8Qc4pU2-dy8v7skBKsn74Lnke1d7x339cQCrba28vlU,11694
|
6
|
+
droidrun/adb/manager.py,sha256=mGdQSlHmZ00t-4jmg_I_qRrBigWnWr_gQXB1TcFXqoQ,2767
|
7
7
|
droidrun/adb/wrapper.py,sha256=Yz3_JSIidq-5bf-t0UfawTutMaLrINS_1Y15m_Uss4g,7093
|
8
8
|
droidrun/agent/__init__.py,sha256=4SqTJeGDvr_wT8rtN9J8hnN6P-pae663mkYr-JmzH4w,208
|
9
9
|
droidrun/agent/codeact/__init__.py,sha256=ZLDGT_lTTzyNm7pcBzdyRIGHJ2ZgbInJdhXZRbJLhSQ,278
|
10
|
-
droidrun/agent/codeact/codeact_agent.py,sha256=
|
10
|
+
droidrun/agent/codeact/codeact_agent.py,sha256=SoJPFeJUfNjs875rsbRSVrSjMIwIpWq_vYcct83PQhU,16075
|
11
11
|
droidrun/agent/codeact/events.py,sha256=skCfZ-5SR0YhhzZVxx8_VkUjfILk8rCv47k9pHNYhdc,634
|
12
12
|
droidrun/agent/codeact/prompts.py,sha256=28HflWMNkC1ky0hGCzAxhJftjU2IIU1ZRUfya3S7M6I,1006
|
13
13
|
droidrun/agent/common/default.py,sha256=P07el-PrHsoqQMYsYxSSln6mFl-QY75vzwp1Dll_XmY,259
|
@@ -18,35 +18,36 @@ droidrun/agent/context/context_injection_manager.py,sha256=sA33q2KPtX_4Yap8wM11T
|
|
18
18
|
droidrun/agent/context/episodic_memory.py,sha256=1ImeR3jAWOpKwkQt3bMlXVOBiQbIli5fBIlBq2waREQ,394
|
19
19
|
droidrun/agent/context/reflection.py,sha256=0hJluOz0hTlHHhReKpIJ9HU5aJbaJsvrjMfraQ84D-M,652
|
20
20
|
droidrun/agent/context/task_manager.py,sha256=ESLs4kR6VNYiYQsc4V7WAeoSLwbaZPSWBXpveOfOv8c,4343
|
21
|
-
droidrun/agent/context/
|
22
|
-
droidrun/agent/context/personas/__init__.py,sha256=tUDIM_9Kim3ki6ZXpwcvPHPSa2cCHNMLdNW4lyJr4gM,231
|
21
|
+
droidrun/agent/context/personas/__init__.py,sha256=Kjze5UDSSjV2EZShXsIM75O1IPprSYop0y0MI4bbPUY,182
|
23
22
|
droidrun/agent/context/personas/app_starter.py,sha256=dHeknznxGEPJ7S6VPyEG_MB-HvAvQwUOnRWaShaV8Xo,1585
|
24
|
-
droidrun/agent/context/personas/default.py,sha256=
|
25
|
-
droidrun/agent/context/personas/extractor.py,sha256=S7Qgh3-Kz_OowQJFJGQUlr8OUVktX5UHVdf5qkAj3GQ,1907
|
23
|
+
droidrun/agent/context/personas/default.py,sha256=Xm07YCWoKjvlHAbQRtzE3vn7BVcz6wYcSVeg4FiojJQ,5060
|
26
24
|
droidrun/agent/context/personas/ui_expert.py,sha256=P2dAnkKiR3O4bN4ZUuWHmuu4Qo8WRiH1mU6EEOr3yJA,4710
|
27
25
|
droidrun/agent/droid/__init__.py,sha256=3BfUVZiUQ8ATAJ_JmqQZQx53WoERRpQ4AyHW5WOgbRI,297
|
28
|
-
droidrun/agent/droid/droid_agent.py,sha256=
|
29
|
-
droidrun/agent/droid/events.py,sha256=
|
26
|
+
droidrun/agent/droid/droid_agent.py,sha256=SEJbFoLDwFqE_nXNke-D4e0lx9DwCY-I-ryywuW6-Y8,14955
|
27
|
+
droidrun/agent/droid/events.py,sha256=Ks2D6lX5P1rpZ4nIAPXSC83z4AT5OzKt3isP5yk25F4,689
|
30
28
|
droidrun/agent/oneflows/reflector.py,sha256=I_tE0PBjvwWbS6SA8Qd41etxJglFgn8oScuKUxc9LEE,11621
|
31
29
|
droidrun/agent/planner/__init__.py,sha256=Fu0Ewtd-dIRLgHIL1DB_9EEKvQS_f1vjB8jgO5TbJXg,364
|
32
30
|
droidrun/agent/planner/events.py,sha256=oyt2FNrA2uVyUeVT65-N0AC6sWBFxSnwNEqWtnRYoFM,390
|
33
|
-
droidrun/agent/planner/planner_agent.py,sha256=
|
31
|
+
droidrun/agent/planner/planner_agent.py,sha256=vcZx8tawMss0F2nt-4QEtdF7kSaikUq3rdWPdTNicjk,10494
|
34
32
|
droidrun/agent/planner/prompts.py,sha256=Ci7Oeu3J4TAhx-tKGPZ9l6Wb3a81FSqC8cWW4jW73HI,6046
|
35
33
|
droidrun/agent/utils/__init__.py,sha256=JK6ygRjw7gzcQSG0HBEYLoVGH54QQAxJJ7HpIS5mgyc,44
|
36
34
|
droidrun/agent/utils/async_utils.py,sha256=IQBcWPwevm89B7R_UdMXk0unWeNCBA232b5kQGqoxNI,336
|
37
|
-
droidrun/agent/utils/chat_utils.py,sha256=
|
35
|
+
droidrun/agent/utils/chat_utils.py,sha256=5oqP2nmKs8sHWP1H_TK82yaxrxWf7FdEbFKASKpR60g,13000
|
38
36
|
droidrun/agent/utils/executer.py,sha256=lQbk2TbPyl_F0k2FqEVimq8cQRcWM_KCO_I7fnkkxqA,4587
|
39
|
-
droidrun/agent/utils/llm_picker.py,sha256=
|
37
|
+
droidrun/agent/utils/llm_picker.py,sha256=16tNkNhEM9gD_uivzxLvuaa6s0Tz7Igu-3fxMP2lAtY,5968
|
40
38
|
droidrun/agent/utils/trajectory.py,sha256=OmO8TvNO0LVtPXg2qTCv8o9ePaMeDyf-MRWN_YObXho,6845
|
41
39
|
droidrun/cli/__init__.py,sha256=DuwSRtZ8WILPd-nf-fZ7BaBsRgtofoInOF3JtJ9wag0,167
|
42
40
|
droidrun/cli/logs.py,sha256=PsT_VbnOa_sOLXK4KkEJk4AsYCpscqrVoryMmLVwPG0,9714
|
43
|
-
droidrun/cli/main.py,sha256=
|
41
|
+
droidrun/cli/main.py,sha256=kGYub0eJt-Ly-fczFPwHs5vq7OC_iP9ZjLZRo1umKcc,16730
|
42
|
+
droidrun/telemetry/__init__.py,sha256=D4Mp02iGJH2Tjpv42Bzyo6_WC3NWj9Qy9hQPWFaCkhA,234
|
43
|
+
droidrun/telemetry/events.py,sha256=S6r6_c2bGTZt6F88m_vREDD_MDhw3Pz4I53lLmsI764,518
|
44
|
+
droidrun/telemetry/tracker.py,sha256=lFVQfOVLuiGulILqVo-nBxJ_u7iC2TDVXwOK4TtHEZA,2611
|
44
45
|
droidrun/tools/__init__.py,sha256=9ReauavtSKDQG9ya9_Fr9O0TQnDFixgOPaP5n82_iEk,271
|
45
|
-
droidrun/tools/adb.py,sha256=
|
46
|
-
droidrun/tools/ios.py,sha256=
|
47
|
-
droidrun/tools/tools.py,sha256=
|
48
|
-
droidrun-0.3.
|
49
|
-
droidrun-0.3.
|
50
|
-
droidrun-0.3.
|
51
|
-
droidrun-0.3.
|
52
|
-
droidrun-0.3.
|
46
|
+
droidrun/tools/adb.py,sha256=8ElV7pNfm-c5FPDoZ7qjzkqtHSjnHzQ_iyEg2e9lhZU,23819
|
47
|
+
droidrun/tools/ios.py,sha256=DrmL_4xtQ5IgJn0vdPKTCJBFxxkz3eNNoo74Ha8ZZVs,23053
|
48
|
+
droidrun/tools/tools.py,sha256=fgl4B62UA5KmxPnAXI1aZY5sncmKl0N97zKrjTdL510,3215
|
49
|
+
droidrun-0.3.2.dist-info/METADATA,sha256=frA--iht9pvq_bTlAnEjWJ_gSbSd4yi42xW6gpF03gs,5838
|
50
|
+
droidrun-0.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
51
|
+
droidrun-0.3.2.dist-info/entry_points.txt,sha256=o259U66js8TIybQ7zs814Oe_LQ_GpZsp6a9Cr-xm5zE,51
|
52
|
+
droidrun-0.3.2.dist-info/licenses/LICENSE,sha256=s-uxn9qChu-kFdRXUp6v_0HhsaJ_5OANmfNOFVm2zdk,1069
|
53
|
+
droidrun-0.3.2.dist-info/RECORD,,
|
@@ -1,52 +0,0 @@
|
|
1
|
-
from droidrun.agent.context.agent_persona import AgentPersona
|
2
|
-
from droidrun.tools import Tools
|
3
|
-
|
4
|
-
EXTRACTOR = AgentPersona(
|
5
|
-
name="DataExtractor",
|
6
|
-
description="Specialized in extracting data from UI elements and screenshots",
|
7
|
-
expertise_areas=[
|
8
|
-
"data extraction",
|
9
|
-
"UI analysis",
|
10
|
-
"text recognition"
|
11
|
-
],
|
12
|
-
allowed_tools=[
|
13
|
-
Tools.extract.__name__,
|
14
|
-
Tools.complete.__name__
|
15
|
-
],
|
16
|
-
required_context=[
|
17
|
-
"ui_state",
|
18
|
-
"screenshot"
|
19
|
-
],
|
20
|
-
user_prompt="""
|
21
|
-
**Current Request:**
|
22
|
-
{goal}
|
23
|
-
**What data needs to be extracted?
|
24
|
-
Analyze the current UI state and screenshot, then extract the requested information.
|
25
|
-
** Explain your thought process then provide code in ```python ... ``` tags if needed.""",
|
26
|
-
|
27
|
-
system_prompt= """
|
28
|
-
You are a Data Extractor Expert specialized in analyzing Android UI states and screenshots to extract specific information. Your core expertise includes:
|
29
|
-
|
30
|
-
**Primary Capabilities:**
|
31
|
-
- Analyze UI elements from ui_state data
|
32
|
-
- Extract text, values, and structured data from screenshots
|
33
|
-
- Identify and parse specific UI components (buttons, text fields, lists, etc.)
|
34
|
-
- Extract data based on user requirements
|
35
|
-
|
36
|
-
## Response Format:
|
37
|
-
Example of proper code format:
|
38
|
-
To extract the current battery percentage from the status bar:
|
39
|
-
```python
|
40
|
-
# Extract battery percentage from UI state
|
41
|
-
battery_data = extract("battery percentage")
|
42
|
-
complete(success=True)
|
43
|
-
```
|
44
|
-
|
45
|
-
In addition to the Python Standard Library and any functions you have already written, you can use the following functions:
|
46
|
-
{tool_descriptions}
|
47
|
-
|
48
|
-
Reminder: Always place your Python code between ```...``` tags when you want to run code.
|
49
|
-
|
50
|
-
You focus ONLY on data extraction from the current UI state and screenshot - navigation and UI interactions are handled by other specialists.""",
|
51
|
-
|
52
|
-
)
|
droidrun/agent/context/todo.txt
DELETED
droidrun/run.py
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
Minimal script to create and run a DroidAgent
|
4
|
-
"""
|
5
|
-
|
6
|
-
import asyncio
|
7
|
-
import os
|
8
|
-
import sys
|
9
|
-
|
10
|
-
# Add the current directory to Python path so we can import droidrun
|
11
|
-
sys.path.insert(0, '/home/sleyn/projects/droidrun')
|
12
|
-
|
13
|
-
async def main():
|
14
|
-
try:
|
15
|
-
# Import required modules
|
16
|
-
from droidrun.agent.droid import DroidAgent
|
17
|
-
from droidrun.agent.utils.llm_picker import load_llm
|
18
|
-
from droidrun.tools.adb import DeviceManager, AdbTools
|
19
|
-
from droidrun.agent.context.personas import DEFAULT, APP_STARTER_EXPERT
|
20
|
-
|
21
|
-
# Configuration
|
22
|
-
goal = """Open the notes app and create a new note"""
|
23
|
-
provider = "Gemini" # Change this to your preferred provider
|
24
|
-
model = "models/gemini-2.5-flash-preview-05-20"
|
25
|
-
|
26
|
-
# Check for API key
|
27
|
-
api_key = os.getenv("GEMINI_API_KEY") #os.getenv("GEMINI_API_KEY")
|
28
|
-
if not api_key:
|
29
|
-
print("❌ Please set GEMINI_API_KEY environment variable")
|
30
|
-
print(" Example: export GEMINI_API_KEY='your-api-key-here'")
|
31
|
-
return
|
32
|
-
|
33
|
-
print(f"🎯 Goal: {goal}")
|
34
|
-
print(f"🤖 Using {provider} with model {model}")
|
35
|
-
|
36
|
-
# Find a connected device
|
37
|
-
device_manager = DeviceManager()
|
38
|
-
devices = await device_manager.list_devices()
|
39
|
-
|
40
|
-
#if not devices:
|
41
|
-
# print("❌ No Android devices found. Please connect a device via ADB.")
|
42
|
-
# print(" Try: adb devices")
|
43
|
-
# return
|
44
|
-
|
45
|
-
device_serial = devices[0].serial
|
46
|
-
#"http://localhost:6643"using the CLI and
|
47
|
-
#device_serial = "http://192.168.100.91:6643"
|
48
|
-
print(f"📱 Using device: {device_serial}")
|
49
|
-
|
50
|
-
# Initialize LLM
|
51
|
-
print("🧠 Initializing LLM...")
|
52
|
-
llm = load_llm(
|
53
|
-
provider_name=provider,
|
54
|
-
model=model,
|
55
|
-
api_key=api_key,
|
56
|
-
temperature=0.2
|
57
|
-
)
|
58
|
-
|
59
|
-
tools = AdbTools(serial=device_serial)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# Create DroidAgent
|
64
|
-
print("🤖 Creating DroidAgent...")
|
65
|
-
agent = DroidAgent(
|
66
|
-
goal=goal,
|
67
|
-
llm=llm,
|
68
|
-
tools=tools,
|
69
|
-
max_steps=100,
|
70
|
-
timeout=3000,
|
71
|
-
reasoning=False,
|
72
|
-
debug=True,
|
73
|
-
save_trajectories=True,
|
74
|
-
enable_tracing=False
|
75
|
-
)
|
76
|
-
|
77
|
-
# Run the agent
|
78
|
-
print("🚀 Running agent...")
|
79
|
-
handler = agent.run()
|
80
|
-
async for nested_ev in handler.stream_events():
|
81
|
-
print(f"EXTERNAL EVENT: {nested_ev.__class__.__name__}")
|
82
|
-
|
83
|
-
result = await handler
|
84
|
-
|
85
|
-
# Print results
|
86
|
-
if result.get("success"):
|
87
|
-
print(f"✅ Success: {result.get('reason', 'Goal completed')}")
|
88
|
-
else:
|
89
|
-
print(f"❌ Failed: {result.get('reason', 'Unknown error')}")
|
90
|
-
|
91
|
-
print(f"📊 Steps taken: {result.get('steps', 0)}")
|
92
|
-
|
93
|
-
if result.get("trajectory"):
|
94
|
-
print(f"📝 Trajectory has {len(result['trajectory'])} steps")
|
95
|
-
|
96
|
-
except ImportError as e:
|
97
|
-
print(f"❌ Import error: {e}")
|
98
|
-
print(" Make sure you're in the droidrun project directory")
|
99
|
-
except Exception as e:
|
100
|
-
print(f"❌ Error: {e}")
|
101
|
-
import traceback
|
102
|
-
traceback.print_exc()
|
103
|
-
|
104
|
-
if __name__ == "__main__":
|
105
|
-
asyncio.run(main())
|
File without changes
|
File without changes
|
File without changes
|