plato-sdk-v2 2.2.4__py3-none-any.whl → 2.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.
@@ -7,6 +7,7 @@ from typing import TYPE_CHECKING
7
7
 
8
8
  from plato._generated.api.v2 import jobs
9
9
  from plato._generated.models import (
10
+ AppApiV2SchemasSessionCreateSnapshotRequest,
10
11
  ConnectRoutingInfoResult,
11
12
  CreateCheckpointRequest,
12
13
  CreateSnapshotResult,
@@ -136,6 +137,36 @@ class Environment:
136
137
  x_api_key=self._api_key,
137
138
  )
138
139
 
140
+ async def snapshot_store(
141
+ self,
142
+ override_service: str | None = None,
143
+ override_version: str | None = None,
144
+ override_dataset: str | None = None,
145
+ ) -> CreateSnapshotResult:
146
+ """Create a snapshot-store snapshot of this environment.
147
+
148
+ Uses the snapshot-store pipeline for chunk-based deduplication and
149
+ efficient storage. This is the preferred method for new base snapshots.
150
+
151
+ Args:
152
+ override_service: Override simulator/service name in artifact metadata.
153
+ override_version: Override version/git_hash in artifact metadata.
154
+ override_dataset: Override dataset name in artifact metadata.
155
+
156
+ Returns:
157
+ CreateSnapshotResult with artifact_id.
158
+ """
159
+ return await jobs.snapshot_store.asyncio(
160
+ client=self._http,
161
+ job_id=self.job_id,
162
+ body=AppApiV2SchemasSessionCreateSnapshotRequest(
163
+ override_service=override_service,
164
+ override_version=override_version,
165
+ override_dataset=override_dataset,
166
+ ),
167
+ x_api_key=self._api_key,
168
+ )
169
+
139
170
  async def close(self) -> None:
140
171
  """Close this environment."""
141
172
  await jobs.close.asyncio(
@@ -34,6 +34,7 @@ from plato._generated.api.v2.sessions import reset as sessions_reset
34
34
  from plato._generated.api.v2.sessions import set_date as sessions_set_date
35
35
  from plato._generated.api.v2.sessions import setup_sandbox as sessions_setup_sandbox
36
36
  from plato._generated.api.v2.sessions import snapshot as sessions_snapshot
37
+ from plato._generated.api.v2.sessions import snapshot_store as sessions_snapshot_store
37
38
  from plato._generated.api.v2.sessions import state as sessions_state
38
39
  from plato._generated.api.v2.sessions import wait_for_ready as sessions_wait_for_ready
39
40
  from plato._generated.models import (
@@ -622,6 +623,38 @@ class Session:
622
623
  x_api_key=self._api_key,
623
624
  )
624
625
 
626
+ async def snapshot_store(
627
+ self,
628
+ override_service: str | None = None,
629
+ override_version: str | None = None,
630
+ override_dataset: str | None = None,
631
+ ) -> AppApiV2SchemasSessionCreateSnapshotResponse:
632
+ """Create a snapshot-store snapshot of all environments in the session.
633
+
634
+ Uses the snapshot-store pipeline for chunk-based deduplication and
635
+ efficient storage. This is the preferred method for new base snapshots.
636
+
637
+ Args:
638
+ override_service: Override simulator/service name in artifact metadata.
639
+ override_version: Override version/git_hash in artifact metadata.
640
+ override_dataset: Override dataset name in artifact metadata.
641
+
642
+ Returns:
643
+ Snapshot response with info per job_id.
644
+ """
645
+ self._check_closed()
646
+
647
+ return await sessions_snapshot_store.asyncio(
648
+ client=self._http,
649
+ session_id=self.session_id,
650
+ body=AppApiV2SchemasSessionCreateSnapshotRequest(
651
+ override_service=override_service,
652
+ override_version=override_version,
653
+ override_dataset=override_dataset,
654
+ ),
655
+ x_api_key=self._api_key,
656
+ )
657
+
625
658
  async def disk_snapshot(
626
659
  self,
627
660
  override_service: str | None = None,
@@ -7,6 +7,7 @@ from typing import TYPE_CHECKING
7
7
 
8
8
  from plato._generated.api.v2 import jobs
9
9
  from plato._generated.models import (
10
+ AppApiV2SchemasSessionCreateSnapshotRequest,
10
11
  CreateCheckpointRequest,
11
12
  CreateSnapshotResult,
12
13
  ExecuteCommandRequest,
@@ -135,6 +136,36 @@ class Environment:
135
136
  x_api_key=self._api_key,
136
137
  )
137
138
 
139
+ def snapshot_store(
140
+ self,
141
+ override_service: str | None = None,
142
+ override_version: str | None = None,
143
+ override_dataset: str | None = None,
144
+ ) -> CreateSnapshotResult:
145
+ """Create a snapshot-store snapshot of this environment.
146
+
147
+ Uses the snapshot-store pipeline for chunk-based deduplication and
148
+ efficient storage. This is the preferred method for new base snapshots.
149
+
150
+ Args:
151
+ override_service: Override simulator/service name in artifact metadata.
152
+ override_version: Override version/git_hash in artifact metadata.
153
+ override_dataset: Override dataset name in artifact metadata.
154
+
155
+ Returns:
156
+ CreateSnapshotResult with artifact_id.
157
+ """
158
+ return jobs.snapshot_store.sync(
159
+ client=self._http,
160
+ job_id=self.job_id,
161
+ body=AppApiV2SchemasSessionCreateSnapshotRequest(
162
+ override_service=override_service,
163
+ override_version=override_version,
164
+ override_dataset=override_dataset,
165
+ ),
166
+ x_api_key=self._api_key,
167
+ )
168
+
138
169
  def close(self) -> None:
139
170
  """Close this environment."""
140
171
  jobs.close.sync(
plato/v2/sync/session.py CHANGED
@@ -32,6 +32,7 @@ from plato._generated.api.v2.sessions import reset as sessions_reset
32
32
  from plato._generated.api.v2.sessions import set_date as sessions_set_date
33
33
  from plato._generated.api.v2.sessions import setup_sandbox as sessions_setup_sandbox
34
34
  from plato._generated.api.v2.sessions import snapshot as sessions_snapshot
35
+ from plato._generated.api.v2.sessions import snapshot_store as sessions_snapshot_store
35
36
  from plato._generated.api.v2.sessions import state as sessions_state
36
37
  from plato._generated.api.v2.sessions import wait_for_ready as sessions_wait_for_ready
37
38
  from plato._generated.models import (
@@ -595,6 +596,38 @@ class Session:
595
596
  x_api_key=self._api_key,
596
597
  )
597
598
 
599
+ def snapshot_store(
600
+ self,
601
+ override_service: str | None = None,
602
+ override_version: str | None = None,
603
+ override_dataset: str | None = None,
604
+ ) -> AppApiV2SchemasSessionCreateSnapshotResponse:
605
+ """Create a snapshot-store snapshot of all environments in the session.
606
+
607
+ Uses the snapshot-store pipeline for chunk-based deduplication and
608
+ efficient storage. This is the preferred method for new base snapshots.
609
+
610
+ Args:
611
+ override_service: Override simulator/service name in artifact metadata.
612
+ override_version: Override version/git_hash in artifact metadata.
613
+ override_dataset: Override dataset name in artifact metadata.
614
+
615
+ Returns:
616
+ Snapshot response with info per job_id.
617
+ """
618
+ self._check_closed()
619
+
620
+ return sessions_snapshot_store.sync(
621
+ client=self._http,
622
+ session_id=self.session_id,
623
+ body=AppApiV2SchemasSessionCreateSnapshotRequest(
624
+ override_service=override_service,
625
+ override_version=override_version,
626
+ override_dataset=override_dataset,
627
+ ),
628
+ x_api_key=self._api_key,
629
+ )
630
+
598
631
  def disk_snapshot(
599
632
  self,
600
633
  override_service: str | None = None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plato-sdk-v2
3
- Version: 2.2.4
3
+ Version: 2.3.0
4
4
  Summary: Python SDK for the Plato API
5
5
  Author-email: Plato <support@plato.so>
6
6
  License-Expression: MIT
@@ -449,15 +449,15 @@ plato/v2/types.py,sha256=MrHiE8AobOegeTfoKKHZ5JTccaFfS3-EW0arV7q8S5c,3533
449
449
  plato/v2/async_/__init__.py,sha256=zcNwuX2XD-WkUCFLvXtdRqFmCgeuY3-D4zGTRVwsAFI,484
450
450
  plato/v2/async_/artifact.py,sha256=JBWVQeVaZhkU2qn_knyzyA7wd5iQ8qxfLQ_l9GPhgYs,1217
451
451
  plato/v2/async_/client.py,sha256=GVgAgNN5gsDME8iV0zxqnwbsVS93J6cknOcq_VXwYN8,4209
452
- plato/v2/async_/environment.py,sha256=Dv_4QuQx5vLVp1m1mJR2fXybvbhz-Q4gLtZecCdyFT8,4622
452
+ plato/v2/async_/environment.py,sha256=M5IeWYLwREOIyuS2zqgBSqHE_x66_OZXrevA9Rkc8Is,5825
453
453
  plato/v2/async_/flow_executor.py,sha256=Tl4nRu1ZPWJFNNxyTGy-PxvebZEUD18ZDaz8T2chtzU,14188
454
- plato/v2/async_/session.py,sha256=3EL4SX1kiYDKd981dRWDZsEu1WtJOXkvbAdw3B5o_EI,35426
454
+ plato/v2/async_/session.py,sha256=ssTEFgfpDQElQEmeKulLWKLoW-wA3m_nI3UvEWb9lB0,36749
455
455
  plato/v2/sync/__init__.py,sha256=_WigxuehCC8A2yRy4mSaMQmIZhS0Gch4hhZC1VHyYXs,310
456
456
  plato/v2/sync/artifact.py,sha256=wTLC-tugG128wLvh-JqNPb0zsw5FXEJlZNahurSWink,1169
457
457
  plato/v2/sync/client.py,sha256=Q9fS1BF4KxTMMnceMwCMlb5dNFZ6LA4gsXWNLgsL2eE,3870
458
- plato/v2/sync/environment.py,sha256=EJS_MBXHQgdOYztmnvcDPyQV1Z0dV6BA-7UEJ_Z-bgE,3878
458
+ plato/v2/sync/environment.py,sha256=WnDzbyEHpwCSEP8XnfNSjIYS7rt7lYR4HGJjzprZmTQ,5066
459
459
  plato/v2/sync/flow_executor.py,sha256=N41-WCWIJVcCR2UmPUEiK7roNacYoeONkRXpR7lUgT8,13941
460
- plato/v2/sync/session.py,sha256=jl0leH3wENQCcOXQruqBcxhb47yo_9QBsdMMktgpnnw,27101
460
+ plato/v2/sync/session.py,sha256=jc71bZFb-1m4QTtU4V00OkNH8fHac3jyWTwq-uOK-BE,28409
461
461
  plato/v2/utils/__init__.py,sha256=XLeFFsjXkm9g2raMmo7Wt4QN4hhCrNZDJKnpffJ4LtM,38
462
462
  plato/v2/utils/db_cleanup.py,sha256=lnI5lsMHNHpG85Y99MaE4Rzc3618piuzhvH-uXO1zIc,8702
463
463
  plato/v2/utils/models.py,sha256=PwehSSnIRG-tM3tWL1PzZEH77ZHhIAZ9R0UPs6YknbM,1441
@@ -468,7 +468,7 @@ plato/worlds/base.py,sha256=254kR0YmRaaOyenDC1jlRhNlEsENgUpcq-crkWJcRe8,15200
468
468
  plato/worlds/build_hook.py,sha256=KSoW0kqa5b7NyZ7MYOw2qsZ_2FkWuz0M3Ru7AKOP7Qw,3486
469
469
  plato/worlds/config.py,sha256=ggDcySspfeFry2KBUwhgnS6Po2KssYzwZNIDmVeGhPQ,9460
470
470
  plato/worlds/runner.py,sha256=RNnWFQ7rfEWE7TQ_tqgLHgLm1a4VxtP0mR7beALx4f0,15781
471
- plato_sdk_v2-2.2.4.dist-info/METADATA,sha256=hUWIc47BNWlYMW32HWQEeSNixo7licBxYJ0G9lnvhaU,8508
472
- plato_sdk_v2-2.2.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
473
- plato_sdk_v2-2.2.4.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
474
- plato_sdk_v2-2.2.4.dist-info/RECORD,,
471
+ plato_sdk_v2-2.3.0.dist-info/METADATA,sha256=JLEH19QIZ3S2O0k4btX1m3KZwYAcAlQm8tmsHFUeT7k,8508
472
+ plato_sdk_v2-2.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
473
+ plato_sdk_v2-2.3.0.dist-info/entry_points.txt,sha256=upGMbJCx6YWUTKrPoYvYUYfFCqYr75nHDwhA-45m6p8,136
474
+ plato_sdk_v2-2.3.0.dist-info/RECORD,,