You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/askui/computer_agent.py
+34-33Lines changed: 34 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,13 @@
17
17
create_computer_agent_prompt,
18
18
)
19
19
fromaskui.tools.computerimport (
20
-
ComputerGetActiveAgentOsServerTool,
20
+
ComputerGetCurrentComputerTargetIdTool,
21
21
ComputerGetMousePositionTool,
22
22
ComputerGetSystemInfoTool,
23
23
ComputerKeyboardPressedTool,
24
24
ComputerKeyboardReleaseTool,
25
25
ComputerKeyboardTapTool,
26
-
ComputerListAgentOsServersTool,
26
+
ComputerListAgentOsTargetComputersTool,
27
27
ComputerListDisplaysTool,
28
28
ComputerMouseClickTool,
29
29
ComputerMouseHoldDownTool,
@@ -33,15 +33,15 @@
33
33
ComputerRetrieveActiveDisplayTool,
34
34
ComputerScreenshotTool,
35
35
ComputerSetActiveDisplayTool,
36
-
ComputerSwitchAgentOsServerTool,
36
+
ComputerSwitchAgentOsTargetComputerTool,
37
37
ComputerTypeTool,
38
38
)
39
39
fromaskui.tools.exception_toolimportExceptionTool
40
40
41
41
from .reportingimportCompositeReporter, Reporter
42
42
from .retryimportRetry
43
43
from .toolsimportAgentToolbox, ComputerAgentOsFacade, ModifierKey, PcKey
44
-
from .tools.askuiimportAgentOsServer, AskUiControllerClient
44
+
from .tools.askuiimportAgentOsTargetComputer, AskUiControllerClient
45
45
46
46
logger=logging.getLogger(__name__)
47
47
@@ -54,27 +54,28 @@ class ComputerAgent(Agent):
54
54
It uses computer vision models to locate UI elements and execute actions on them.
55
55
56
56
A single `ComputerAgent` can drive **one or more machines** through the
57
-
`agent_os_servers` argument. Each entry is an Agent OS server (local
58
-
subprocess or remote gRPC endpoint) identified by a stable `computer_id`.
59
-
At any moment one server is *active* and receives all explicit calls
60
-
(`click`, `type`, `keyboard`, ...). The active server can be changed at
61
-
runtime via `agent.tools.os.switch_agent_os_server(computer_id)` or
62
-
scoped to a block using `agent.tools.os.temporary_select(computer_id)`.
63
-
The `act()` model is also given list/switch/get-active tools so it can
64
-
orchestrate work across machines on its own (e.g. read something on one
65
-
computer and re-enter it on another).
57
+
`agent_os_target_computers` argument. Each entry is an Agent OS target
58
+
computer (local subprocess or remote gRPC endpoint) identified by a stable
59
+
`computer_id`. At any moment one target is *active* and receives all
60
+
explicit calls (`click`, `type`, `keyboard`, ...). The active target can be
61
+
changed at runtime via
62
+
`agent.tools.os.switch_agent_os_target_computer(computer_id)` or scoped to a
63
+
block using `agent.tools.os.temporary_select(computer_id)`. The `act()`
64
+
model is also given list/switch/get-current tools so it can orchestrate
65
+
work across machines on its own (e.g. read something on one computer and
66
+
re-enter it on another).
66
67
67
68
Args:
68
-
display (int, optional): The display number to use for screen interactions on the default local server. Ignored when `agent_os_servers` is provided. Defaults to `1`.
69
+
display (int, optional): The display number to use for screen interactions on the default local target. Ignored when `agent_os_target_computers` is provided. Defaults to `1`.
69
70
reporters (list[Reporter] | None, optional): List of reporter instances for logging and reporting. If `None`, an empty list is used.
Target computers the agent can route actions to. May mix one
73
+
`LocalAgentOsTargetComputer` (managing a controller subprocess on this
74
+
machine) with any number of `RemoteAgentOsTargetComputer`s pointing at
74
75
controllers already running on other machines. Constraints: at
75
-
least one server, at most one local, and remote `address`es plus
76
+
least one target, at most one local, and remote `address`es plus
76
77
all `computer_id`s must be unique. The first entry becomes the
77
-
initial active server. Defaults to a single local server bound to
78
+
initial active target. Defaults to a single local target bound to
78
79
`display`.
79
80
settings (AgentSettings | None, optional): Provider-based model settings. If `None`, uses the default AskUI model stack.
80
81
retry (Retry, optional): The retry instance to use for retrying failed actions. Defaults to `ConfigurableRetry` with exponential backoff. Currently only supported for `locate()` method.
@@ -94,18 +95,18 @@ class ComputerAgent(Agent):
94
95
95
96
Example:
96
97
Research on one machine and write up the findings on another. The
97
-
first server in the list is the active one; `temporary_select`
98
+
first target in the list is the active one; `temporary_select`
98
99
re-routes a block of explicit calls and restores the previous
99
-
active server on exit.
100
+
active target on exit.
100
101
101
102
```python
102
103
from askui import ComputerAgent
103
-
from askui.tools.askui import LocalAgentOsServer, RemoteAgentOsServer
104
+
from askui.tools.askui import LocalAgentOsTargetComputer, RemoteAgentOsTargetComputer
0 commit comments