lybic-guiagents 0.2.2__py3-none-any.whl → 0.3.0__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.
Potentially problematic release.
This version of lybic-guiagents might be problematic. Click here for more details.
- gui_agents/__init__.py +1 -1
- gui_agents/agents/Backend/LybicBackend.py +25 -19
- gui_agents/agents/agent_s.py +292 -97
- gui_agents/agents/grounding.py +43 -6
- gui_agents/agents/manager.py +113 -18
- gui_agents/agents/stream_manager.py +163 -0
- gui_agents/agents/worker.py +60 -35
- gui_agents/cli_app.py +16 -5
- gui_agents/core/knowledge.py +36 -5
- gui_agents/grpc_app.py +784 -0
- gui_agents/proto/__init__.py +3 -0
- gui_agents/proto/pb/__init__.py +4 -0
- gui_agents/tools/model.md +351 -0
- gui_agents/tools/tools.py +80 -39
- gui_agents/tools/tools_config.json +101 -0
- gui_agents/tools/tools_config_cn.json +101 -0
- gui_agents/tools/tools_config_en.json +101 -0
- {lybic_guiagents-0.2.2.dist-info → lybic_guiagents-0.3.0.dist-info}/METADATA +86 -8
- {lybic_guiagents-0.2.2.dist-info → lybic_guiagents-0.3.0.dist-info}/RECORD +23 -16
- lybic_guiagents-0.3.0.dist-info/entry_points.txt +3 -0
- gui_agents/lybic_client/__init__.py +0 -0
- gui_agents/lybic_client/lybic_client.py +0 -88
- {lybic_guiagents-0.2.2.dist-info → lybic_guiagents-0.3.0.dist-info}/WHEEL +0 -0
- {lybic_guiagents-0.2.2.dist-info → lybic_guiagents-0.3.0.dist-info}/licenses/LICENSE +0 -0
- {lybic_guiagents-0.2.2.dist-info → lybic_guiagents-0.3.0.dist-info}/top_level.txt +0 -0
gui_agents/__init__.py
CHANGED
|
@@ -37,7 +37,7 @@ from .agents.hardware_interface import HardwareInterface
|
|
|
37
37
|
from .store.registry import Registry
|
|
38
38
|
from .agents.global_state import GlobalState
|
|
39
39
|
|
|
40
|
-
__version__ = "0.
|
|
40
|
+
__version__ = "0.3.0"
|
|
41
41
|
|
|
42
42
|
# Primary exports (what users should typically use)
|
|
43
43
|
__all__ = [
|
|
@@ -27,7 +27,7 @@ from gui_agents.agents.Backend.Backend import Backend
|
|
|
27
27
|
|
|
28
28
|
# 导入官方Lybic SDK
|
|
29
29
|
try:
|
|
30
|
-
from lybic import LybicClient, Sandbox, ComputerUse, dto
|
|
30
|
+
from lybic import LybicClient, Sandbox, ComputerUse, dto, LybicAuth
|
|
31
31
|
except ImportError:
|
|
32
32
|
raise ImportError(
|
|
33
33
|
"Lybic Python SDK not found. Please install it with: pip install --upgrade lybic"
|
|
@@ -57,18 +57,22 @@ class LybicBackend(Backend):
|
|
|
57
57
|
precreate_sid: str = '',
|
|
58
58
|
**kwargs):
|
|
59
59
|
"""
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
Initialize the LybicBackend, create and configure the Lybic SDK client, and ensure a sandbox is available.
|
|
61
|
+
|
|
62
|
+
Parameters:
|
|
63
|
+
api_key (Optional[str]): Lybic API key; if None the value is read from the LYBIC_API_KEY environment variable.
|
|
64
|
+
org_id (Optional[str]): Lybic organization ID; if None the value is read from the LYBIC_ORG_ID environment variable.
|
|
65
|
+
endpoint (Optional[str]): API endpoint; if None the value is read from LYBIC_API_ENDPOINT (default "https://api.lybic.cn").
|
|
66
|
+
timeout (int): Request timeout in seconds for the SDK client.
|
|
67
|
+
extra_headers (Optional[Dict[str, str]]): Additional HTTP headers to pass to the SDK via LybicAuth.
|
|
68
|
+
sandbox_opts (Optional[Dict[str, Any]]): Options used when creating a new sandbox; LYBIC_MAX_LIFE_SECONDS is applied as the default for `maxLifeSeconds` if not provided.
|
|
69
|
+
max_retries (int): Maximum number of retry attempts for action execution.
|
|
70
|
+
precreate_sid (str): Pre-created sandbox ID to use; if empty, a new sandbox will be created.
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
ValueError: If neither api_key nor org_id are provided (and not present in the corresponding environment variables).
|
|
74
|
+
RuntimeError: If sandbox creation completes but no sandbox ID can be obtained from the SDK response.
|
|
75
|
+
"""
|
|
72
76
|
self.loop = asyncio.new_event_loop()
|
|
73
77
|
asyncio.set_event_loop(self.loop)
|
|
74
78
|
|
|
@@ -84,11 +88,13 @@ class LybicBackend(Backend):
|
|
|
84
88
|
# 初始化SDK客户端(仅在有必要参数时)
|
|
85
89
|
if self.api_key and self.org_id:
|
|
86
90
|
self.client = LybicClient(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
LybicAuth(
|
|
92
|
+
org_id=self.org_id,
|
|
93
|
+
api_key=self.api_key,
|
|
94
|
+
endpoint=self.endpoint,
|
|
95
|
+
extra_headers=self.extra_headers or {}
|
|
96
|
+
),
|
|
90
97
|
timeout=self.timeout,
|
|
91
|
-
extra_headers=self.extra_headers or {}
|
|
92
98
|
)
|
|
93
99
|
else:
|
|
94
100
|
raise ValueError("LYBIC_API_KEY and LYBIC_ORG_ID are required. Please set them as environment variables or pass them as arguments.")
|
|
@@ -185,7 +191,7 @@ class LybicBackend(Backend):
|
|
|
185
191
|
type="mouse:click",
|
|
186
192
|
x=dto.PixelLength(type="px", value=act.x),
|
|
187
193
|
y=dto.PixelLength(type="px", value=act.y),
|
|
188
|
-
button=
|
|
194
|
+
button=act.button,
|
|
189
195
|
holdKey=" ".join(act.holdKey) if act.holdKey else ""
|
|
190
196
|
)
|
|
191
197
|
|
|
@@ -203,7 +209,7 @@ class LybicBackend(Backend):
|
|
|
203
209
|
type="mouse:doubleClick",
|
|
204
210
|
x=dto.PixelLength(type="px", value=act.x),
|
|
205
211
|
y=dto.PixelLength(type="px", value=act.y),
|
|
206
|
-
button=
|
|
212
|
+
button=act.button,
|
|
207
213
|
holdKey=" ".join(act.holdKey) if act.holdKey else ""
|
|
208
214
|
)
|
|
209
215
|
|