agentscope-runtime 1.0.4__py3-none-any.whl → 1.0.4a1__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.
- agentscope_runtime/adapters/agentscope/stream.py +7 -1
- agentscope_runtime/cli/commands/deploy.py +0 -371
- agentscope_runtime/engine/__init__.py +0 -4
- agentscope_runtime/engine/constant.py +0 -1
- agentscope_runtime/engine/deployers/__init__.py +0 -12
- agentscope_runtime/engine/deployers/adapter/a2a/__init__.py +51 -26
- agentscope_runtime/engine/deployers/adapter/a2a/a2a_protocol_adapter.py +10 -19
- agentscope_runtime/engine/deployers/adapter/a2a/a2a_registry.py +201 -4
- agentscope_runtime/engine/deployers/adapter/a2a/nacos_a2a_registry.py +25 -134
- agentscope_runtime/engine/deployers/agentrun_deployer.py +2 -2
- agentscope_runtime/engine/runner.py +0 -12
- agentscope_runtime/engine/tracing/wrapper.py +4 -18
- agentscope_runtime/sandbox/__init__.py +6 -14
- agentscope_runtime/sandbox/box/base/__init__.py +2 -2
- agentscope_runtime/sandbox/box/base/base_sandbox.py +1 -51
- agentscope_runtime/sandbox/box/browser/__init__.py +2 -2
- agentscope_runtime/sandbox/box/browser/browser_sandbox.py +2 -198
- agentscope_runtime/sandbox/box/filesystem/__init__.py +2 -2
- agentscope_runtime/sandbox/box/filesystem/filesystem_sandbox.py +2 -99
- agentscope_runtime/sandbox/box/gui/__init__.py +2 -2
- agentscope_runtime/sandbox/box/gui/gui_sandbox.py +1 -117
- agentscope_runtime/sandbox/box/mobile/__init__.py +2 -2
- agentscope_runtime/sandbox/box/mobile/mobile_sandbox.py +100 -247
- agentscope_runtime/sandbox/box/sandbox.py +65 -98
- agentscope_runtime/sandbox/box/shared/routers/generic.py +29 -36
- agentscope_runtime/sandbox/client/__init__.py +1 -6
- agentscope_runtime/sandbox/client/http_client.py +329 -108
- agentscope_runtime/sandbox/enums.py +0 -7
- agentscope_runtime/sandbox/manager/sandbox_manager.py +4 -264
- agentscope_runtime/sandbox/manager/server/app.py +1 -7
- agentscope_runtime/version.py +1 -1
- {agentscope_runtime-1.0.4.dist-info → agentscope_runtime-1.0.4a1.dist-info}/METADATA +28 -102
- {agentscope_runtime-1.0.4.dist-info → agentscope_runtime-1.0.4a1.dist-info}/RECORD +37 -46
- agentscope_runtime/adapters/ms_agent_framework/__init__.py +0 -0
- agentscope_runtime/adapters/ms_agent_framework/message.py +0 -205
- agentscope_runtime/adapters/ms_agent_framework/stream.py +0 -418
- agentscope_runtime/adapters/utils.py +0 -6
- agentscope_runtime/common/container_clients/knative_client.py +0 -466
- agentscope_runtime/engine/deployers/fc_deployer.py +0 -1506
- agentscope_runtime/engine/deployers/knative_deployer.py +0 -290
- agentscope_runtime/sandbox/client/async_http_client.py +0 -339
- agentscope_runtime/sandbox/client/base.py +0 -74
- {agentscope_runtime-1.0.4.dist-info → agentscope_runtime-1.0.4a1.dist-info}/WHEEL +0 -0
- {agentscope_runtime-1.0.4.dist-info → agentscope_runtime-1.0.4a1.dist-info}/entry_points.txt +0 -0
- {agentscope_runtime-1.0.4.dist-info → agentscope_runtime-1.0.4a1.dist-info}/licenses/LICENSE +0 -0
- {agentscope_runtime-1.0.4.dist-info → agentscope_runtime-1.0.4a1.dist-info}/top_level.txt +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import io
|
|
3
3
|
import sys
|
|
4
4
|
import logging
|
|
5
|
-
import
|
|
5
|
+
import subprocess
|
|
6
6
|
import traceback
|
|
7
7
|
from contextlib import redirect_stderr, redirect_stdout
|
|
8
8
|
|
|
@@ -44,33 +44,26 @@ async def run_ipython_cell(
|
|
|
44
44
|
stdout_buf = io.StringIO()
|
|
45
45
|
stderr_buf = io.StringIO()
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"IPython cell transformation failed: "
|
|
61
|
-
"transformed_cell is None."
|
|
62
|
-
),
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
asyncio.run(
|
|
66
|
-
ipy.run_cell_async(
|
|
67
|
-
code,
|
|
68
|
-
transformed_cell=transformed_cell,
|
|
69
|
-
preprocessing_exc_tuple=preprocessing_exc_tuple,
|
|
70
|
-
),
|
|
47
|
+
with redirect_stdout(stdout_buf), redirect_stderr(stderr_buf):
|
|
48
|
+
preprocessing_exc_tuple = None
|
|
49
|
+
try:
|
|
50
|
+
transformed_cell = ipy.transform_cell(code)
|
|
51
|
+
except Exception:
|
|
52
|
+
transformed_cell = code
|
|
53
|
+
preprocessing_exc_tuple = sys.exc_info()
|
|
54
|
+
|
|
55
|
+
if transformed_cell is None:
|
|
56
|
+
raise HTTPException(
|
|
57
|
+
status_code=500,
|
|
58
|
+
detail="IPython cell transformation failed: "
|
|
59
|
+
"transformed_cell is None.",
|
|
71
60
|
)
|
|
72
61
|
|
|
73
|
-
|
|
62
|
+
await ipy.run_cell_async(
|
|
63
|
+
code,
|
|
64
|
+
transformed_cell=transformed_cell,
|
|
65
|
+
preprocessing_exc_tuple=preprocessing_exc_tuple,
|
|
66
|
+
)
|
|
74
67
|
|
|
75
68
|
stdout_content = stdout_buf.getvalue()
|
|
76
69
|
stderr_content = stderr_buf.getvalue()
|
|
@@ -135,16 +128,16 @@ async def run_shell_command(
|
|
|
135
128
|
if not command:
|
|
136
129
|
raise HTTPException(status_code=400, detail="Command is required.")
|
|
137
130
|
|
|
138
|
-
|
|
131
|
+
result = subprocess.run(
|
|
139
132
|
command,
|
|
140
|
-
|
|
141
|
-
|
|
133
|
+
shell=True,
|
|
134
|
+
stdout=subprocess.PIPE,
|
|
135
|
+
stderr=subprocess.PIPE,
|
|
136
|
+
text=True,
|
|
137
|
+
check=False,
|
|
142
138
|
)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
stdout_content = stdout_bytes.decode()
|
|
147
|
-
stderr_content = stderr_bytes.decode()
|
|
139
|
+
stdout_content = result.stdout
|
|
140
|
+
stderr_content = result.stderr
|
|
148
141
|
|
|
149
142
|
content_list = []
|
|
150
143
|
|
|
@@ -168,7 +161,7 @@ async def run_shell_command(
|
|
|
168
161
|
content_list.append(
|
|
169
162
|
TextContent(
|
|
170
163
|
type="text",
|
|
171
|
-
text=str(
|
|
164
|
+
text=str(result.returncode),
|
|
172
165
|
description="returncode",
|
|
173
166
|
),
|
|
174
167
|
)
|
|
@@ -180,7 +173,7 @@ async def run_shell_command(
|
|
|
180
173
|
+ "\n"
|
|
181
174
|
+ stderr_content
|
|
182
175
|
+ "\n"
|
|
183
|
-
+ str(
|
|
176
|
+
+ str(result.returncode),
|
|
184
177
|
description="output",
|
|
185
178
|
),
|
|
186
179
|
)
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
from .http_client import SandboxHttpClient
|
|
3
3
|
from .training_client import TrainingSandboxClient
|
|
4
|
-
from .async_http_client import SandboxHttpAsyncClient
|
|
5
4
|
|
|
6
|
-
__all__ = [
|
|
7
|
-
"SandboxHttpClient",
|
|
8
|
-
"SandboxHttpAsyncClient",
|
|
9
|
-
"TrainingSandboxClient",
|
|
10
|
-
]
|
|
5
|
+
__all__ = ["SandboxHttpClient", "TrainingSandboxClient"]
|