plato-sdk-v2 2.3.3__py3-none-any.whl → 2.4.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.
- plato/agents/__init__.py +24 -16
- plato/agents/artifacts.py +108 -0
- plato/agents/config.py +16 -13
- plato/agents/otel.py +261 -0
- plato/agents/runner.py +223 -149
- plato/chronos/models/__init__.py +9 -1
- plato/v1/cli/agent.py +7 -7
- plato/v1/cli/chronos.py +767 -0
- plato/v1/cli/main.py +2 -0
- plato/v1/cli/pm.py +3 -3
- plato/v1/cli/sandbox.py +58 -6
- plato/v1/cli/ssh.py +21 -14
- plato/v1/cli/templates/world-runner.Dockerfile +27 -0
- plato/v1/cli/utils.py +32 -12
- plato/worlds/README.md +2 -1
- plato/worlds/base.py +222 -101
- plato/worlds/config.py +5 -3
- plato/worlds/runner.py +1 -391
- {plato_sdk_v2-2.3.3.dist-info → plato_sdk_v2-2.4.2.dist-info}/METADATA +4 -3
- {plato_sdk_v2-2.3.3.dist-info → plato_sdk_v2-2.4.2.dist-info}/RECORD +22 -25
- plato/agents/logging.py +0 -515
- plato/chronos/api/callback/__init__.py +0 -11
- plato/chronos/api/callback/push_agent_logs.py +0 -61
- plato/chronos/api/callback/update_agent_status.py +0 -57
- plato/chronos/api/callback/upload_artifacts.py +0 -59
- plato/chronos/api/callback/upload_logs_zip.py +0 -57
- plato/chronos/api/callback/upload_trajectory.py +0 -57
- {plato_sdk_v2-2.3.3.dist-info → plato_sdk_v2-2.4.2.dist-info}/WHEEL +0 -0
- {plato_sdk_v2-2.3.3.dist-info → plato_sdk_v2-2.4.2.dist-info}/entry_points.txt +0 -0
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"""Upload Logs Zip Endpoint"""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Any
|
|
6
|
-
|
|
7
|
-
import httpx
|
|
8
|
-
|
|
9
|
-
from plato.chronos.errors import raise_for_status
|
|
10
|
-
from plato.chronos.models import LogsUploadRequest, LogsUploadResponse
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _build_request_args(
|
|
14
|
-
body: LogsUploadRequest,
|
|
15
|
-
) -> dict[str, Any]:
|
|
16
|
-
"""Build request arguments."""
|
|
17
|
-
url = "/api/callback/logs-zip"
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
"method": "POST",
|
|
21
|
-
"url": url,
|
|
22
|
-
"json": body.model_dump(mode="json", exclude_none=True),
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def sync(
|
|
27
|
-
client: httpx.Client,
|
|
28
|
-
body: LogsUploadRequest,
|
|
29
|
-
) -> LogsUploadResponse:
|
|
30
|
-
"""Upload zipped logs for a session.
|
|
31
|
-
|
|
32
|
-
Accepts base64-encoded zip file and uploads to S3."""
|
|
33
|
-
|
|
34
|
-
request_args = _build_request_args(
|
|
35
|
-
body=body,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
response = client.request(**request_args)
|
|
39
|
-
raise_for_status(response)
|
|
40
|
-
return LogsUploadResponse.model_validate(response.json())
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
async def asyncio(
|
|
44
|
-
client: httpx.AsyncClient,
|
|
45
|
-
body: LogsUploadRequest,
|
|
46
|
-
) -> LogsUploadResponse:
|
|
47
|
-
"""Upload zipped logs for a session.
|
|
48
|
-
|
|
49
|
-
Accepts base64-encoded zip file and uploads to S3."""
|
|
50
|
-
|
|
51
|
-
request_args = _build_request_args(
|
|
52
|
-
body=body,
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
response = await client.request(**request_args)
|
|
56
|
-
raise_for_status(response)
|
|
57
|
-
return LogsUploadResponse.model_validate(response.json())
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"""Upload Trajectory Endpoint"""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Any
|
|
6
|
-
|
|
7
|
-
import httpx
|
|
8
|
-
|
|
9
|
-
from plato.chronos.errors import raise_for_status
|
|
10
|
-
from plato.chronos.models import TrajectoryUploadRequest, TrajectoryUploadResponse
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def _build_request_args(
|
|
14
|
-
body: TrajectoryUploadRequest,
|
|
15
|
-
) -> dict[str, Any]:
|
|
16
|
-
"""Build request arguments."""
|
|
17
|
-
url = "/api/callback/trajectory"
|
|
18
|
-
|
|
19
|
-
return {
|
|
20
|
-
"method": "POST",
|
|
21
|
-
"url": url,
|
|
22
|
-
"json": body.model_dump(mode="json", exclude_none=True),
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def sync(
|
|
27
|
-
client: httpx.Client,
|
|
28
|
-
body: TrajectoryUploadRequest,
|
|
29
|
-
) -> TrajectoryUploadResponse:
|
|
30
|
-
"""Upload AITF trajectory for a session.
|
|
31
|
-
|
|
32
|
-
Accepts an AITF-formatted trajectory and stores it in the database."""
|
|
33
|
-
|
|
34
|
-
request_args = _build_request_args(
|
|
35
|
-
body=body,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
response = client.request(**request_args)
|
|
39
|
-
raise_for_status(response)
|
|
40
|
-
return TrajectoryUploadResponse.model_validate(response.json())
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
async def asyncio(
|
|
44
|
-
client: httpx.AsyncClient,
|
|
45
|
-
body: TrajectoryUploadRequest,
|
|
46
|
-
) -> TrajectoryUploadResponse:
|
|
47
|
-
"""Upload AITF trajectory for a session.
|
|
48
|
-
|
|
49
|
-
Accepts an AITF-formatted trajectory and stores it in the database."""
|
|
50
|
-
|
|
51
|
-
request_args = _build_request_args(
|
|
52
|
-
body=body,
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
response = await client.request(**request_args)
|
|
56
|
-
raise_for_status(response)
|
|
57
|
-
return TrajectoryUploadResponse.model_validate(response.json())
|
|
File without changes
|
|
File without changes
|