lybic-guiagents 0.2.2__py3-none-any.whl → 0.2.3__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.

@@ -0,0 +1,101 @@
1
+ {
2
+ "tools": [
3
+ {
4
+ "tool_name": "websearch",
5
+ "provider": "bocha",
6
+ "model_name": ""
7
+ },
8
+ {
9
+ "tool_name": "context_fusion",
10
+ "provider": "doubao",
11
+ "model_name": "doubao-seed-1-6-flash-250615"
12
+ },
13
+ {
14
+ "tool_name": "subtask_planner",
15
+ "provider": "doubao",
16
+ "model_name": "doubao-seed-1-6-250615"
17
+ },
18
+ {
19
+ "tool_name": "traj_reflector",
20
+ "provider": "doubao",
21
+ "model_name": "doubao-seed-1-6-250615"
22
+ },
23
+ {
24
+ "tool_name": "memory_retrival",
25
+ "provider": "doubao",
26
+ "model_name": "doubao-seed-1-6-flash-250615"
27
+ },
28
+ {
29
+ "tool_name": "grounding",
30
+ "provider": "doubao",
31
+ "model_name": "doubao-1-5-ui-tars-250428"
32
+ },
33
+ {
34
+ "tool_name": "evaluator",
35
+ "provider": "doubao",
36
+ "model_name": "doubao-seed-1-6-flash-250615"
37
+ },
38
+ {
39
+ "tool_name": "action_generator",
40
+ "provider": "doubao",
41
+ "model_name": "doubao-seed-1-6-250615",
42
+ "enable_search": false,
43
+ "search_provider": "bocha",
44
+ "search_model": ""
45
+ },
46
+ {
47
+ "tool_name": "action_generator_with_takeover",
48
+ "provider": "doubao",
49
+ "model_name": "doubao-seed-1-6-250615",
50
+ "enable_search": false,
51
+ "search_provider": "bocha",
52
+ "search_model": ""
53
+ },
54
+ {
55
+ "tool_name": "fast_action_generator",
56
+ "provider": "doubao",
57
+ "model_name": "doubao-1-5-ui-tars-250428",
58
+ "enable_search": false,
59
+ "search_provider": "bocha",
60
+ "search_model": ""
61
+ },
62
+ {
63
+ "tool_name": "fast_action_generator_with_takeover",
64
+ "provider": "doubao",
65
+ "model_name": "doubao-1-5-ui-tars-250428",
66
+ "enable_search": false,
67
+ "search_provider": "bocha",
68
+ "search_model": ""
69
+ },
70
+ {
71
+ "tool_name": "dag_translator",
72
+ "provider": "doubao",
73
+ "model_name": "doubao-seed-1-6-250615"
74
+ },
75
+ {
76
+ "tool_name": "embedding",
77
+ "provider": "doubao",
78
+ "model_name": "doubao-embedding-text-240715"
79
+ },
80
+ {
81
+ "tool_name": "query_formulator",
82
+ "provider": "doubao",
83
+ "model_name": "doubao-seed-1-6-flash-250615"
84
+ },
85
+ {
86
+ "tool_name": "narrative_summarization",
87
+ "provider": "doubao",
88
+ "model_name": "doubao-seed-1-6-flash-250615"
89
+ },
90
+ {
91
+ "tool_name": "text_span",
92
+ "provider": "doubao",
93
+ "model_name": "doubao-seed-1-6-flash-250615"
94
+ },
95
+ {
96
+ "tool_name": "episode_summarization",
97
+ "provider": "doubao",
98
+ "model_name": "doubao-seed-1-6-flash-250615"
99
+ }
100
+ ]
101
+ }
@@ -0,0 +1,101 @@
1
+ {
2
+ "tools": [
3
+ {
4
+ "tool_name": "websearch",
5
+ "provider": "exa",
6
+ "model_name": "exa-research"
7
+ },
8
+ {
9
+ "tool_name": "context_fusion",
10
+ "provider": "gemini",
11
+ "model_name": "gemini-2.5-pro"
12
+ },
13
+ {
14
+ "tool_name": "subtask_planner",
15
+ "provider": "gemini",
16
+ "model_name": "gemini-2.5-pro"
17
+ },
18
+ {
19
+ "tool_name": "traj_reflector",
20
+ "provider": "gemini",
21
+ "model_name": "gemini-2.5-pro"
22
+ },
23
+ {
24
+ "tool_name": "memory_retrival",
25
+ "provider": "gemini",
26
+ "model_name": "gemini-2.5-pro"
27
+ },
28
+ {
29
+ "tool_name": "grounding",
30
+ "provider": "doubao",
31
+ "model_name": "doubao-1-5-ui-tars-250428"
32
+ },
33
+ {
34
+ "tool_name": "evaluator",
35
+ "provider": "gemini",
36
+ "model_name": "gemini-2.5-pro"
37
+ },
38
+ {
39
+ "tool_name": "action_generator",
40
+ "provider": "gemini",
41
+ "model_name": "gemini-2.5-pro",
42
+ "enable_search": false,
43
+ "search_provider": "exa",
44
+ "search_model": "exa-research"
45
+ },
46
+ {
47
+ "tool_name": "action_generator_with_takeover",
48
+ "provider": "gemini",
49
+ "model_name": "gemini-2.5-pro",
50
+ "enable_search": false,
51
+ "search_provider": "exa",
52
+ "search_model": "exa-research"
53
+ },
54
+ {
55
+ "tool_name": "fast_action_generator",
56
+ "provider": "gemini",
57
+ "model_name": "gemini-2.5-pro",
58
+ "enable_search": false,
59
+ "search_provider": "exa",
60
+ "search_model": "exa-research"
61
+ },
62
+ {
63
+ "tool_name": "fast_action_generator_with_takeover",
64
+ "provider": "gemini",
65
+ "model_name": "gemini-2.5-pro",
66
+ "enable_search": false,
67
+ "search_provider": "exa",
68
+ "search_model": "exa-research"
69
+ },
70
+ {
71
+ "tool_name": "dag_translator",
72
+ "provider": "gemini",
73
+ "model_name": "gemini-2.5-pro"
74
+ },
75
+ {
76
+ "tool_name": "embedding",
77
+ "provider": "gemini",
78
+ "model_name": "text-embedding-004"
79
+ },
80
+ {
81
+ "tool_name": "query_formulator",
82
+ "provider": "gemini",
83
+ "model_name": "gemini-2.5-pro"
84
+ },
85
+ {
86
+ "tool_name": "narrative_summarization",
87
+ "provider": "gemini",
88
+ "model_name": "gemini-2.5-pro"
89
+ },
90
+ {
91
+ "tool_name": "text_span",
92
+ "provider": "gemini",
93
+ "model_name": "gemini-2.5-pro"
94
+ },
95
+ {
96
+ "tool_name": "episode_summarization",
97
+ "provider": "gemini",
98
+ "model_name": "gemini-2.5-pro"
99
+ }
100
+ ]
101
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lybic-guiagents
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: An open-source agentic framework that enables AI to use computers like humans and can provide a multi-agent runtime environment as an infrastructure capability
5
5
  Author: Lybic Development Team
6
6
  Author-email: Lybic Development Team <lybic@tingyutech.com>
@@ -23,13 +23,21 @@ Requires-Dist: boto3
23
23
  Requires-Dist: scikit-learn
24
24
  Requires-Dist: tiktoken
25
25
  Requires-Dist: pydantic
26
- Requires-Dist: lybic>=0.7.3
26
+ Requires-Dist: lybic<1.0.0,>=0.8.0b2
27
+ Requires-Dist: grpcio
28
+ Requires-Dist: grpcio-tools>=1.71.2
27
29
  Requires-Dist: pyobjc; platform_system == "Darwin"
28
30
  Requires-Dist: oa_atomacos; platform_system == "Darwin"
29
31
  Requires-Dist: pywinauto; platform_system == "Windows"
30
32
  Requires-Dist: pywin32; platform_system == "Windows"
33
+ Requires-Dist: pytest>=8.4.2
34
+ Requires-Dist: protobuf>=5.29.5
35
+ Requires-Dist: googleapis-common-protos>=1.70.0
31
36
  Provides-Extra: dev
32
37
  Requires-Dist: pytest; extra == "dev"
38
+ Provides-Extra: grpc
39
+ Requires-Dist: grpcio; extra == "grpc"
40
+ Requires-Dist: grpcio-tools>=1.71.2; extra == "grpc"
33
41
  Provides-Extra: vmware-and-evaluation
34
42
  Requires-Dist: python-pptx; extra == "vmware-and-evaluation"
35
43
  Requires-Dist: odfpy; extra == "vmware-and-evaluation"
@@ -148,6 +156,8 @@ Requires-Dist: pyobjc; platform_system == "Darwin" and extra == "all"
148
156
  Requires-Dist: oa_atomacos; platform_system == "Darwin" and extra == "all"
149
157
  Requires-Dist: pywinauto; platform_system == "Windows" and extra == "all"
150
158
  Requires-Dist: pywin32; platform_system == "Windows" and extra == "all"
159
+ Requires-Dist: grpcio; extra == "all"
160
+ Requires-Dist: grpcio-tools>=1.71.2; extra == "all"
151
161
  Dynamic: author
152
162
  Dynamic: license-file
153
163
  Dynamic: requires-python
@@ -372,6 +382,13 @@ python gui_agents/cli_app.py --backend pyautogui --mode fast
372
382
  > [!WARNING]
373
383
  > The agent will directly control your computer with `--backend pyautogui`. Please use with care.
374
384
 
385
+ ### Docker
386
+ You can also run Lybic GUI Agent using Docker. This is an example of how to run it with the `lybic` backend:
387
+ ```sh
388
+ docker run --rm -it --env-file gui_agents/.env agenticlybic/guiagent --backend lybic
389
+ ```
390
+ > **Note**: This command starts the agent in interactive mode. The `--env-file` flag points to the environment file. Please ensure the path is correct.
391
+
375
392
  ### Lybic Sandbox Configuration
376
393
 
377
394
  The simplest way to configure Lybic Sandbox is still to edit the `.env` file and add your API keys, as mentioned in the [API Key Configuration](#api-key-configuration) section.
@@ -392,15 +409,19 @@ LYBIC_MAX_LIFE_SECONDS=3600
392
409
 
393
410
  ### Use as a service
394
411
 
395
- After installing lybic-guiagents, you can run it as a service.
412
+ You can interact with the agent programmatically either by importing it as a Python library or by running it as a gRPC service.
413
+
414
+ #### As a Python Library
415
+
416
+ After installing `lybic-guiagents`, you can import and use its components directly in your Python code.
396
417
 
397
418
  Main Components:
398
- - AgentService: High-level service interface (recommended for most users)
399
- - AgentS2, AgentSFast: Core agent implementations
400
- - HardwareInterface: Hardware abstraction layer
401
- - ServiceConfig: Configuration management
419
+ - `AgentService`: High-level service interface (recommended for most users).
420
+ - `AgentS2`, `AgentSFast`: Core agent implementations.
421
+ - `HardwareInterface`: Hardware abstraction layer for controlling the GUI.
422
+ - `ServiceConfig`: Configuration management.
402
423
 
403
- Quick Start:
424
+ **Quick Start:**
404
425
 
405
426
  ```python
406
427
  from gui_agents import AgentService
@@ -409,6 +430,63 @@ result = service.execute_task("Take a screenshot")
409
430
  print(f"Task completed: {result.status}")
410
431
  ```
411
432
 
433
+ #### As a gRPC Service
434
+
435
+ You can also run the agent as a standalone gRPC service, which is ideal for distributed architectures or integrating with applications written in other languages.
436
+
437
+ **1. Running the gRPC Server**
438
+
439
+ First, run the gRPC server using Docker. This command overrides the default CLI entrypoint and starts the gRPC service on port 50051.
440
+
441
+ ```sh
442
+ docker run --rm -it -p 50051:50051 --env-file gui_agents/.env agenticlybic/guiagent /app/.venv/bin/lybic-guiagent-grpc
443
+ ```
444
+ > **Note**: The `-p 50051:50051` flag maps the container's gRPC port to your host machine.
445
+
446
+ **2. Python Client Example**
447
+
448
+ Once the service is running, you can interact with it using a gRPC client. Here is a Python example of how to send an instruction to the agent and stream its progress.
449
+
450
+ First, ensure you have the necessary gRPC libraries and generated protobuf stubs:
451
+ ```sh
452
+ # Install gRPC tools
453
+ pip install grpcio grpcio-tools
454
+
455
+ # Generate stubs from the .proto file
456
+ python -m grpc_tools.protoc -Igui_agents/proto --python_out=gui_agents/proto/pb --grpc_python_out=gui_agents/proto/pb --pyi_out=gui_agents/proto/pb gui_agents/proto/agent.proto
457
+ ```
458
+
459
+ Then, you can use the following script to communicate with the agent:
460
+
461
+ ```python
462
+ import asyncio
463
+ import grpc
464
+ from gui_agents.proto.pb import agent_pb2, agent_pb2_grpc
465
+
466
+ async def run_agent_instruction():
467
+ # Connect to the gRPC server
468
+ async with grpc.aio.insecure_channel('localhost:50051') as channel:
469
+ # Create a stub for the Agent service
470
+ stub = agent_pb2_grpc.AgentStub(channel)
471
+
472
+ # Create a request to run an instruction
473
+ request = agent_pb2.RunAgentInstructionRequest(
474
+ instruction="Open a calculator and compute 1 + 1"
475
+ )
476
+
477
+ print(f"Sending instruction: '{request.instruction}'")
478
+
479
+ # Call the RunAgentInstruction RPC and iterate over the stream of responses
480
+ try:
481
+ async for response in stub.RunAgentInstruction(request):
482
+ print(f"[{response.stage}] {response.message}")
483
+ except grpc.aio.AioRpcError as e:
484
+ print(f"An error occurred: {e.details()}")
485
+
486
+ if __name__ == '__main__':
487
+ asyncio.run(run_agent_instruction())
488
+ ```
489
+
412
490
  ### VMware Configuration
413
491
 
414
492
  To use PyAutoGUI with VMware, you need to install [VMware Workstation Pro](https://www.vmware.com/products/desktop-hypervisor/workstation-and-fusion) (on Windows) and create a virtual machine.
@@ -51,31 +51,33 @@ desktop_env/providers/virtualbox/provider.py,sha256=kSWLSddLpn8IfeyAPyMEy_p5SOap
51
51
  desktop_env/providers/vmware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
52
  desktop_env/providers/vmware/manager.py,sha256=pFqJwF6BAijmD-LbSei68-DU7ILCTONRj7e0At5iKIg,18893
53
53
  desktop_env/providers/vmware/provider.py,sha256=88ERND67KQIxG74b10sAXJ04o5FhNpx0d9pRTi8bHrA,4080
54
- gui_agents/__init__.py,sha256=lbM57x5ZeJ51oDtCLVie760uT3UUJAInHdeKksYQZ4c,1603
55
- gui_agents/cli_app.py,sha256=M8zO24xPTD4WDuLgnSqSjJ6VA3SFq0-qyLncizh6D04,29046
54
+ gui_agents/__init__.py,sha256=Gv3YvOee6_8RentnSfQawXZWy2h9XaYFPtbhfSVJjgI,1603
55
+ gui_agents/cli_app.py,sha256=Zwf8H9gl31Q-IwKFMKzDTudsCOtmDK7VVIVSFqIAPh8,30289
56
+ gui_agents/grpc_app.py,sha256=j_TPshxIzIA1PMbkBKH_7VfTjbg4hLquGGMjB0dmEec,37088
56
57
  gui_agents/agents/Action.py,sha256=aEqkrNtb5TWn5i5nkMBWTN56_9tbfRPEGw2SgkFYKeY,6197
57
58
  gui_agents/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
58
- gui_agents/agents/agent_s.py,sha256=LUxLENjuHRrgycfzKjYmyZXmd5Xv3XHPAWy6g9_BvoE,34322
59
+ gui_agents/agents/agent_s.py,sha256=VwrkISbQcKGp9joDTb4BW2MDK810WfUFZSmpZJjaeEc,45795
59
60
  gui_agents/agents/global_state.py,sha256=BS6tUeK9Z3CdUIeU0gcEjzVnc_s7naeKQsCoIQLp23g,22314
60
- gui_agents/agents/grounding.py,sha256=9BGp_emVAODZgberH2IqgjVCCNDx-eUNbe1mdnUt7ZA,22764
61
+ gui_agents/agents/grounding.py,sha256=bOy9V19Z_SO-hbUqg5h6Ru7E4k9YDGiXsQ_RArGuolg,25262
61
62
  gui_agents/agents/hardware_interface.py,sha256=32auvpVwJ-DimTTCDguM49DEBR4JeFCeHx41Bgv3Svg,5332
62
- gui_agents/agents/manager.py,sha256=I00ycDd8cBwXm6tJAzkTEccDE0P_R04ZAjn0uXGySY0,24030
63
+ gui_agents/agents/manager.py,sha256=44E5fTELymcSMBBUUzG7y2ntcT-DL5yA0OoZnTIq2v8,28861
64
+ gui_agents/agents/stream_manager.py,sha256=FxkM5GtTI4mFRd5rmuvoLSaC2NINVsSfhhREw3VlmUA,6704
63
65
  gui_agents/agents/translator.py,sha256=WwWY1ffs2OQuh65DSVjWpfpettJVdmmCI-w92K0JeHg,5171
64
- gui_agents/agents/worker.py,sha256=QO8pPh7YtGYZc8E5I1ACGHXzRELNnchpusK6tVNAxWA,15297
66
+ gui_agents/agents/worker.py,sha256=OTvrnnV_b28DmmIp3E9s8hZ6o3LlWcsV19FLSddTl08,17962
65
67
  gui_agents/agents/Backend/ADBBackend.py,sha256=J8WeFFLEPh05FmFKuGz72wgcKdKQT9kLUCHyEb8mRkk,2151
66
68
  gui_agents/agents/Backend/Backend.py,sha256=Aou3gBfur0AqL_bMn9FFeLTBM4CfL5aiIRivjqaB6zk,978
67
- gui_agents/agents/Backend/LybicBackend.py,sha256=A5QG4P3QAcAQO-MM7jmKU4zr5s98KReysCuQIHUU7Ec,13166
69
+ gui_agents/agents/Backend/LybicBackend.py,sha256=mDjvP3Rx1cjuWkFN0X9QiWWeqBnfepUHGwDIsCmI_As,14069
68
70
  gui_agents/agents/Backend/PyAutoGUIBackend.py,sha256=KX6_cB0sW_sNAcqYhnzQ6ksMJ1cDPK1OWRXet26qg_8,6064
69
71
  gui_agents/agents/Backend/PyAutoGUIVMwareBackend.py,sha256=_AEKf4qU5EiKIDOD64bicEwiGnjp-wsX5Q14v9e79M4,9910
70
72
  gui_agents/agents/Backend/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
73
  gui_agents/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
72
74
  gui_agents/core/engine.py,sha256=_KbY4BkJ_CsAaIDSUkGK8JQ7hLG3GZ2Cn-pT5xzIPj0,54561
73
- gui_agents/core/knowledge.py,sha256=vAyp3JZz2bWKCN6leWDO5FjF1pdLHgXp5EDxuUSjVro,18181
75
+ gui_agents/core/knowledge.py,sha256=PpAf09E1N3fIFK2dPkM-XnxdcxKAhyvezvMYHsjDbXE,19879
74
76
  gui_agents/core/mllm.py,sha256=k3BIILmb7eaNBu_pXQaD5cRpVBGkrLVQqkxQzzseZdo,21191
75
- gui_agents/lybic_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
- gui_agents/lybic_client/lybic_client.py,sha256=E9_TRtQChEkFGe74J4HrkapVaFCG0TkjxeW9z0Je--s,2994
77
77
  gui_agents/prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
78
  gui_agents/prompts/prompts.py,sha256=w9ZP4FhuBDzWP7J0Urn69woLhas9AIWTtNfC1tys59c,67050
79
+ gui_agents/proto/__init__.py,sha256=_PORrnlylDiijb0s_soqgb1REm1eqXOtSmo0Oah4KRM,85
80
+ gui_agents/proto/pb/__init__.py,sha256=UbJYRSLmdZrc2F6ou4dkvgGb4Y0YDObcwftmJCE3fC0,96
79
81
  gui_agents/service/__init__.py,sha256=5WsJ0Mx3e5BAP9qQMhoVimhOgTIndGeVcasGNoo1s-c,518
80
82
  gui_agents/service/agent_service.py,sha256=ZAPQjO76GRP7P0n_prU76NK5d7fzHk1pqLJ7a9rHt-Q,20969
81
83
  gui_agents/service/api_models.py,sha256=06iFyaV6ttROsNiS2GnAAaB4kR1XNpSRuUHD2W60L8o,3949
@@ -84,7 +86,11 @@ gui_agents/service/exceptions.py,sha256=Tk3U4eycX-wuAqR0B-TthBESKyu8KuwH5Ksng0v4
84
86
  gui_agents/store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
87
  gui_agents/store/registry.py,sha256=KWySYUlRA5SGubqqCgOu5Lk7PvBIQQ4cEZmHoNwKzVQ,615
86
88
  gui_agents/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
- gui_agents/tools/tools.py,sha256=vv6jlgUUXyop86GwiVzQYxccTCaH7ErQcjDXX3-l5yM,27555
89
+ gui_agents/tools/model.md,sha256=xeEuG3sBFu5j614V6alVk7l7JZmEewLniEg1hh7qA6Y,5553
90
+ gui_agents/tools/tools.py,sha256=mPWed16cbGvje49M405qi0WVHh1qNxQkW5ojLz9Ac9Y,30785
91
+ gui_agents/tools/tools_config.json,sha256=cXhrCMvj-ktI77CAblkX_5dujVg29p2rZovjTW2zvx8,2552
92
+ gui_agents/tools/tools_config_cn.json,sha256=ChRIbIK-QF4QLeOR2b8hO_VwRVvTWAC-T2RhzPy45cA,2546
93
+ gui_agents/tools/tools_config_en.json,sha256=2jjQFGJAOdn9qjddcfwAtyDkaj2pOtOtF4LuNWn_F60,2426
88
94
  gui_agents/unit_test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
95
  gui_agents/unit_test/run_tests.py,sha256=HuByLtSZ1TXbn_QWduA51L4BYcv_oM6ctGcyWcoqPq8,1773
90
96
  gui_agents/unit_test/test_manager.py,sha256=Tj_jPtjL4xtEA37Cjn-48qBPqdj0K2Gup0tW17kdGeY,13539
@@ -95,8 +101,9 @@ gui_agents/utils/common_utils.py,sha256=lfWg7SrGfEnu9ZS9AWP3GKhbeTbaSZ6F9oh6U_qC
95
101
  gui_agents/utils/display_viewer.py,sha256=hL6Pf-wpoQrrYeOi6eaGnCorkAvGWNzkLIuM9yIudnk,8731
96
102
  gui_agents/utils/embedding_manager.py,sha256=7QFITe9l0z8OKHT-yqx-BGwVMj4BRL2iJ13PgJ2-Yak,2117
97
103
  gui_agents/utils/image_axis_utils.py,sha256=z21cVAE2ZOK1DR7wK10JHg8aZapkX2oGI6D93pKZEao,878
98
- lybic_guiagents-0.2.2.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
99
- lybic_guiagents-0.2.2.dist-info/METADATA,sha256=ZVhQC9zXiTIR0rNRRoz2Gr8RyPcvs8fDjvyFYiEA2HU,20655
100
- lybic_guiagents-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
101
- lybic_guiagents-0.2.2.dist-info/top_level.txt,sha256=NFP1jNNbbEGUexavwh7g0z_23hahrdgEV_9AjdynSw0,23
102
- lybic_guiagents-0.2.2.dist-info/RECORD,,
104
+ lybic_guiagents-0.2.3.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
105
+ lybic_guiagents-0.2.3.dist-info/METADATA,sha256=lza969_FxsoPQ5n6JWVI6ZOeIPt_kgVGnr6qhS5qXjk,23821
106
+ lybic_guiagents-0.2.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
+ lybic_guiagents-0.2.3.dist-info/entry_points.txt,sha256=n8OTYmXL0QPhSFUz-StUmhf0cpdL7Qcaeg5BWe7MiL4,106
108
+ lybic_guiagents-0.2.3.dist-info/top_level.txt,sha256=NFP1jNNbbEGUexavwh7g0z_23hahrdgEV_9AjdynSw0,23
109
+ lybic_guiagents-0.2.3.dist-info/RECORD,,
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ lybic-guiagent = gui_agents.cli_app:main
3
+ lybic-guiagent-grpc = gui_agents.grpc_app:main
File without changes
@@ -1,88 +0,0 @@
1
- import httpx
2
- from typing import Optional, Dict, Any
3
-
4
- class LybicClient:
5
- """Light-weight async wrapper for Lybic REST API."""
6
-
7
- # ---------- life-cycle ----------
8
- def __init__(self, api_key: str, base_url: str, org_id: str) -> None:
9
- self.base = base_url.rstrip("/")
10
- self.org_id = org_id
11
- self.http = httpx.AsyncClient(
12
- headers={"X-Api-Key": api_key, "Content-Type": "application/json"},
13
- timeout=30,
14
- )
15
-
16
- # runtime cache (set by create_sandbox)
17
- self.sandbox: Optional[Dict[str, Any]] = None
18
- # self.connect_details: Optional[Dict[str, Any]] = None
19
-
20
- async def close(self) -> None:
21
- await self.http.aclose()
22
-
23
- # ---------- low-level ----------
24
- async def _req(self, path: str, method: str = "GET", json: Any = None):
25
- r = await self.http.request(method, f"{self.base}{path}", json=json)
26
- # ▶ 打印调试信息
27
- req = r.request # httpx.Request 对象
28
- print(
29
- "[HTTP]", req.method, req.url, # 完整 URL(含 querystring)
30
- "json=", json,
31
- "status=", r.status_code,
32
- )
33
-
34
- r.raise_for_status()
35
- return r.json()
36
-
37
- # ---------- high-level ----------
38
- async def create_sandbox(self, **opts) -> Dict[str, Any]:
39
- """
40
- Create a new sandbox and cache its metadata / connectDetails.
41
- Returns the full response dict.
42
- """
43
- resp = await self._req(
44
- f"/api/orgs/{self.org_id}/sandboxes", "POST", opts or {}
45
- )
46
-
47
- # cache
48
- self.sandbox = resp
49
- # self.connect_details = resp.get("connectDetails")
50
- return resp
51
-
52
- def _require_sandbox_id(self, sid: Optional[str]) -> str:
53
- if sid:
54
- return sid
55
- if self.sandbox:
56
- return self.sandbox["id"]
57
- raise RuntimeError("No sandbox_id specified and none cached — "
58
- "call create_sandbox() first.")
59
-
60
- async def preview(self, sid: Optional[str] = None):
61
- sid = self._require_sandbox_id(sid)
62
- return await self._req(
63
- f"/api/orgs/{self.org_id}/sandboxes/{sid}/preview", "POST"
64
- )
65
-
66
- async def exec_action(self, action: dict, sid: Optional[str] = None):
67
- """
68
- Execute a single GUI action. `sid` optional if sandbox already cached.
69
- """
70
- sid = self._require_sandbox_id(sid)
71
- return await self._req(
72
- f"/api/orgs/{self.org_id}/sandboxes/{sid}/actions/computer-use",
73
- "POST",
74
- {"action": action},
75
- )
76
-
77
- async def parse_nl(self, text: str, model: str = "ui-tars"):
78
- return await self._req(
79
- "/api/computer-use/parse",
80
- "POST",
81
- {"model": model, "textContent": text},
82
- )
83
-
84
- # ---------- helpers ----------
85
- @property
86
- def sandbox_id(self) -> Optional[str]:
87
- return self.sandbox["id"] if self.sandbox else None
88
-