sequence-base 0.8.0rc2__tar.gz → 0.8.0rc3__tar.gz
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.
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/PKG-INFO +1 -2
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/pyproject.toml +2 -2
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/__init__.py +1 -3
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/by_name.py +8 -28
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/codec/blocks.py +2 -7
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/codec/compressed.py +1 -2
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/__init__.py +7 -6
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/accounts.py +1 -1
- sequence_base-0.8.0rc3/sequence_base/contract/connect.py +32 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/deployments.py +0 -14
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/observe.py +6 -24
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/own_io.py +1 -7
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/planner.py +1 -2
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/policy.py +0 -15
- sequence_base-0.8.0rc3/sequence_base/contract/wire.py +60 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/msgpack_io.py +2 -8
- sequence_base-0.8.0rc3/sequence_base/presets/prompts.py +11 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schema_export.py +1 -4
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ActRequest.json +18 -6
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ActResponse.json +0 -8
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/DeploymentPolicy.json +0 -5
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/DeploymentRequest.json +0 -5
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PolicyRegistration.json +0 -5
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PolicySpec.json +0 -5
- sequence_base-0.8.0rc2/sequence_base/contract/connect.py +0 -96
- sequence_base-0.8.0rc2/sequence_base/contract/wire.py +0 -47
- sequence_base-0.8.0rc2/sequence_base/presets/frames.py +0 -180
- sequence_base-0.8.0rc2/sequence_base/schemas/ConnectRequest.json +0 -28
- sequence_base-0.8.0rc2/sequence_base/schemas/ConnectResponse.json +0 -204
- sequence_base-0.8.0rc2/sequence_base/schemas/Standby.json +0 -92
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/.gitignore +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/README.md +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/auth.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/codec/__init__.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/codec/image.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/codec/marked.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/constants/__init__.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/constants/cards.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/constants/headers.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/constants/limits.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/constants/version.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/construct.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/adapters.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/benchmarks.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/errors.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/eval.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/flags.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/settings.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/templates.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/contract/volumes.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/episode.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/errors/__init__.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/errors/transport.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/obs/__init__.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/obs/log.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/obs/rid.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/presets/__init__.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/presets/robot_arm.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ActionChunk.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ActionContract.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ActionStep.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/AdapterPair.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/AddLocal.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Autoscaler.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/BenchmarkRegisterRequest.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/BenchmarkSpec.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/BenchmarkStatusResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/BootstrapResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Camera.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/CodeBundle.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Concurrency.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/DeploymentAccepted.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/DeploymentStatusResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ErrorBody.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ErrorCodes.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Estimate.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/EvalDryRunResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/EvalReport.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/EvalRequest.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/EvalResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageFrame.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageSpec.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepAddLocal.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepApt.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepEnv.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepProject.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepRun.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepTemplateFiles.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ImageStepUvPip.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/InferParam.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Lease.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/MetricAgg.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Observation.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ObservationContract.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ObserveRequest.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ObserveResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlanAppend.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlanAppended.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerMember.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerObservation.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerObserve.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerObserved.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerPlanIn.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerPlans.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerPlansWritten.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerRobot.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerRound.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerRoundRequest.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/PlannerSpec.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Project.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Proprioception.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/ReplaySpec.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Resources.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/RolloutResult.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SecretCreateRequest.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SecretInfo.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SecretRef.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SeqFlags.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SettingsChange.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SettingsChanged.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/SettingsView.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/TaskAgg.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/TemplateFiles.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Tensors.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/Timeouts.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/UploadTarget.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/VolumeFile.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/VolumeInfo.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/VolumeMount.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/VolumeRef.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/VolumeUploadRequest.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/VolumeUploadResponse.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/schemas/WarmingError.json +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/telemetry/__init__.py +0 -0
- {sequence_base-0.8.0rc2 → sequence_base-0.8.0rc3}/sequence_base/telemetry/events.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: sequence-base
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.0rc3
|
|
4
4
|
Summary: Shared foundation for the Sequences platform — wire contract, correlation, error taxonomy, constants. Used by the robot SDK, gateway, and container harness.
|
|
5
5
|
Project-URL: Changelog, https://generalsequences.com/docs/changelog/
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -13,7 +13,6 @@ Requires-Dist: av>=17; extra == 'observe'
|
|
|
13
13
|
Requires-Dist: numpy>=1.26; extra == 'observe'
|
|
14
14
|
Requires-Dist: zstandard>=0.22; extra == 'observe'
|
|
15
15
|
Provides-Extra: test
|
|
16
|
-
Requires-Dist: hypothesis>=6; extra == 'test'
|
|
17
16
|
Requires-Dist: jsonschema>=4; extra == 'test'
|
|
18
17
|
Requires-Dist: pytest; extra == 'test'
|
|
19
18
|
Requires-Dist: pyyaml; extra == 'test'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "sequence-base"
|
|
3
|
-
version = "0.8.
|
|
3
|
+
version = "0.8.0rc3"
|
|
4
4
|
description = "Shared foundation for the Sequences platform — wire contract, correlation, error taxonomy, constants. Used by the robot SDK, gateway, and container harness."
|
|
5
5
|
requires-python = ">=3.10"
|
|
6
6
|
dependencies = ["pydantic>=2.0"]
|
|
@@ -11,7 +11,7 @@ Changelog = "https://generalsequences.com/docs/changelog/"
|
|
|
11
11
|
[project.optional-dependencies]
|
|
12
12
|
codec = ["pillow>=10", "numpy>=1.26"]
|
|
13
13
|
observe = ["numpy>=1.26", "av>=17", "zstandard>=0.22"]
|
|
14
|
-
test = ["pytest", "jsonschema>=4", "
|
|
14
|
+
test = ["pytest", "jsonschema>=4", "pyyaml"]
|
|
15
15
|
|
|
16
16
|
[build-system]
|
|
17
17
|
requires = ["hatchling"]
|
|
@@ -55,8 +55,6 @@ from sequence_base.contract import (
|
|
|
55
55
|
BootstrapResponse,
|
|
56
56
|
CodeBundle,
|
|
57
57
|
Concurrency,
|
|
58
|
-
ConnectRequest,
|
|
59
|
-
ConnectResponse,
|
|
60
58
|
DeploymentAccepted,
|
|
61
59
|
DeploymentPolicy,
|
|
62
60
|
InferParam,
|
|
@@ -149,7 +147,7 @@ __all__ = [
|
|
|
149
147
|
"Resources", "Autoscaler", "Timeouts", "DeploymentPolicy", "InferParam", "DeploymentRequest",
|
|
150
148
|
"DeploymentAccepted", "DeploymentState", "DeploymentStatusResponse",
|
|
151
149
|
|
|
152
|
-
"Lease",
|
|
150
|
+
"Lease",
|
|
153
151
|
|
|
154
152
|
"ReplaySpec", "BenchmarkSpec", "BenchmarkRegisterRequest", "BenchmarkStatusResponse",
|
|
155
153
|
"EvalRequest", "Estimate", "EvalResponse", "EvalDryRunResponse", "RolloutResult",
|
|
@@ -16,10 +16,9 @@ declared (seq/named.py, registry.infer_params), the worker when it calls the met
|
|
|
16
16
|
rule on both sides.
|
|
17
17
|
|
|
18
18
|
What the platform hands a method itself is `episode` - an act function, an observe function and the method an
|
|
19
|
-
episode's end calls alike - and an eval's `seed`; `
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
declared, the worker when it loads one declared before.
|
|
19
|
+
episode's end calls alike - and an eval's `seed`; `ends(parameters, what)` refuses an end method that needs anything but
|
|
20
|
+
the episode, in words that say what to write instead, when the SDK declares a class.
|
|
21
|
+
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
A composite's planner, @seq.plan, is called on a clock with the episode alone and what it returns is kept in the
|
|
@@ -34,8 +33,8 @@ from collections.abc import Iterable, Mapping
|
|
|
34
33
|
from dataclasses import dataclass
|
|
35
34
|
from typing import Any
|
|
36
35
|
|
|
37
|
-
__all__ = ["INFER_PLATFORM", "OBSERVE_PLATFORM", "
|
|
38
|
-
"
|
|
36
|
+
__all__ = ["INFER_PLATFORM", "OBSERVE_PLATFORM", "WAKE_ON", "ByName", "ends", "plan_refused", "takes_by_name",
|
|
37
|
+
"wake_on_refused"]
|
|
39
38
|
|
|
40
39
|
|
|
41
40
|
|
|
@@ -43,15 +42,6 @@ INFER_PLATFORM = frozenset({"seed", "episode"})
|
|
|
43
42
|
OBSERVE_PLATFORM = frozenset({"step", "episode"})
|
|
44
43
|
|
|
45
44
|
|
|
46
|
-
RETIRED = {"episode_id": "take episode, a seq.Episode, and read episode.id",
|
|
47
|
-
"embodiment": "send what the robot is with its observations, in observe(x)",
|
|
48
|
-
"feedback": "send what the robot was playing with its observations, in observe(x)",
|
|
49
|
-
|
|
50
|
-
"plan": ('take episode and read the newest plan as episode.state["seq.plans"][-1]["value"], what '
|
|
51
|
-
'@seq.plan returned (before the first, episode.state.get("seq.plans") is None)'),
|
|
52
|
-
"robot": ("take episode: episode.state is the robot's own dict, which @seq.plan is handed too, and "
|
|
53
|
-
"episode.id names it")}
|
|
54
|
-
|
|
55
45
|
WAKE_ON = ('@seq.plan(wake_on=...) is a list of the observation\'s keys whose arrival plans at once, each a string - '
|
|
56
46
|
'wake_on=["say"]: an observation that holds "say" plans its episode then, its clock going on beside')
|
|
57
47
|
|
|
@@ -114,22 +104,12 @@ def takes_by_name(parameters: Iterable[inspect.Parameter], platform: frozenset[s
|
|
|
114
104
|
rest=any(p.kind is inspect.Parameter.VAR_KEYWORD for p in every), platform=frozenset(platform))
|
|
115
105
|
|
|
116
106
|
|
|
117
|
-
def retired(parameters: Iterable[inspect.Parameter], what: str) -> str | None:
|
|
118
|
-
"""Why `what` ("Model.infer"), a method the platform calls, cannot be deployed: it takes what the platform no longer
|
|
119
|
-
hands it (RETIRED), said with what to write instead - or None, when it takes none of it."""
|
|
120
|
-
names = [p.name for p in parameters if p.name in RETIRED]
|
|
121
|
-
if not names:
|
|
122
|
-
return None
|
|
123
|
-
return (f"{what} takes {' and '.join(names)}, which the platform no longer hands it: "
|
|
124
|
-
+ "; ".join(RETIRED[n] for n in names))
|
|
125
|
-
|
|
126
|
-
|
|
127
107
|
def ends(parameters: Iterable[inspect.Parameter], what: str) -> str | None:
|
|
128
108
|
"""Why `what` ("Model.end"), the method an episode's end calls (@seq.on_episode), cannot be deployed: an episode's
|
|
129
|
-
end hands it the episode alone, so it takes `episode` or nothing
|
|
130
|
-
|
|
109
|
+
end hands it the episode alone, so it takes `episode` or nothing, or any other argument with a default - or None,
|
|
110
|
+
when it does."""
|
|
131
111
|
taken = [p.name for p in parameters if p.kind not in _VARIADIC
|
|
132
|
-
and
|
|
112
|
+
and p.name != "episode" and p.default is inspect.Parameter.empty]
|
|
133
113
|
if not taken:
|
|
134
114
|
return None
|
|
135
115
|
name = what.rsplit(".", 1)[-1]
|
|
@@ -4,8 +4,7 @@ of one whose content its worker already holds, and what the worker turns back -
|
|
|
4
4
|
large input sent again with every observation, goes up once.
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
In one sentence: the SDK, packing an observation for
|
|
8
|
-
or str of MIN_BLOCK_BYTES or more into blocks - an array stacked along its first axis, 2 to SPLIT_MAX slices each of
|
|
7
|
+
In one sentence: the SDK, packing an observation for its worker, cuts each unmarked numpy array, bytes or str of MIN_BLOCK_BYTES or more into blocks - an array stacked along its first axis, 2 to SPLIT_MAX slices each of
|
|
9
8
|
MIN_BLOCK_BYTES or more, a block a slice - each named by the first ID_BYTES of its sha256 (block_id) → puts a reference
|
|
10
9
|
in its place (encode) → its post carries the content of each block its worker does not hold (ObserveRequest.blocks), as
|
|
11
10
|
both sides count what the worker holds (Retention) → the worker keeps each episode's blocks and, as each observation's
|
|
@@ -36,14 +35,10 @@ from typing import Any, Iterable, Mapping
|
|
|
36
35
|
|
|
37
36
|
from sequence_base.codec.compressed import is_compressed
|
|
38
37
|
from sequence_base.codec.marked import MARK, is_marked
|
|
39
|
-
from sequence_base.contract.observe import BLOCKS_FORMAT
|
|
40
38
|
|
|
41
|
-
__all__ = ["
|
|
39
|
+
__all__ = ["ID_BYTES", "KEEP_OBSERVATIONS", "KINDS", "MIN_BLOCK_BYTES", "SPLIT_MAX", "VERSION", "BlocksError",
|
|
42
40
|
"MissingBlock", "Retention", "block_id", "cut", "decode", "encode", "ids_of", "is_reference"]
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
FORMAT = BLOCKS_FORMAT
|
|
47
42
|
KINDS = ("array", "bytes", "str")
|
|
48
43
|
VERSION = 1
|
|
49
44
|
ID_BYTES = 16
|
|
@@ -6,8 +6,7 @@ after the worker is handed the bytes the robot built.
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
In one sentence: the robot's SDK compresses an unmarked numpy array or bytes of 16 KiB or more with zstd level 1 (zlib
|
|
9
|
-
level 1 where it has no zstd) and puts the map below in its place →
|
|
10
|
-
only it is sent such maps → as a post comes, before anything keeps it, expand() turns every map back into the array or
|
|
9
|
+
level 1 where it has no zstd) and puts the map below in its place → as a post comes, before anything keeps it, expand() turns every map back into the array or
|
|
11
10
|
bytes it was (np.frombuffer: read-only, as msgpack_io reads an array) and says how many bytes that added.
|
|
12
11
|
|
|
13
12
|
The map, version 1 (inside the observe body's msgpack; `data` is bin):
|
|
@@ -46,7 +46,7 @@ from sequence_base.contract.policy import (
|
|
|
46
46
|
)
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
from sequence_base.contract.own_io import
|
|
49
|
+
from sequence_base.contract.own_io import Tensors
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
from sequence_base.contract.deployments import (
|
|
@@ -64,7 +64,7 @@ from sequence_base.contract.deployments import (
|
|
|
64
64
|
)
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
from sequence_base.contract.connect import
|
|
67
|
+
from sequence_base.contract.connect import Lease
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
from sequence_base.contract.benchmarks import (
|
|
@@ -135,7 +135,7 @@ from sequence_base.contract.planner import (
|
|
|
135
135
|
PLANNER_ID,
|
|
136
136
|
POLICY_ID,
|
|
137
137
|
ROBOT_ID,
|
|
138
|
-
|
|
138
|
+
WAITING_FOR_PLAN,
|
|
139
139
|
PlanAppend,
|
|
140
140
|
PlanAppended,
|
|
141
141
|
PlannerMember,
|
|
@@ -165,13 +165,13 @@ __all__ = [
|
|
|
165
165
|
"TemplateFiles", "ImageStepTemplateFiles", "Project", "ImageStepProject", "FROZEN_PATH", "ImageStep", "ImageSpec",
|
|
166
166
|
"VolumeMount", "VolumeRef", "Concurrency", "ActionContract", "Camera", "ObservationContract",
|
|
167
167
|
"PolicySpec", "PolicyRegistration", "PolicyConstructor", "CHUNK_NAMES",
|
|
168
|
-
"
|
|
168
|
+
"Tensors",
|
|
169
169
|
|
|
170
170
|
"MAX_CODE_BUNDLE_BYTES", "CodeBundle",
|
|
171
171
|
"Resources", "Autoscaler", "Timeouts", "DeploymentPolicy", "InferParam", "DeploymentRequest",
|
|
172
172
|
"DeploymentAccepted", "DeploymentState", "DeploymentStatusResponse",
|
|
173
173
|
|
|
174
|
-
"Lease",
|
|
174
|
+
"Lease",
|
|
175
175
|
|
|
176
176
|
"ReplaySpec", "BenchmarkSpec", "BenchmarkRegisterRequest", "BenchmarkStatusResponse",
|
|
177
177
|
"EvalRequest", "Estimate", "EvalResponse", "EvalDryRunResponse", "RolloutResult",
|
|
@@ -185,7 +185,8 @@ __all__ = [
|
|
|
185
185
|
"SETTINGS", "Setting", "SettingsChange", "Applied", "SettingState", "SettingsView", "SettingChanged",
|
|
186
186
|
"SettingsChanged",
|
|
187
187
|
|
|
188
|
-
"KEPT", "MOST_LAYERS", "PLANS_MOST", "STATE_MOST", "PLAN_ON_A_POLICY", "PLANNER_ID", "POLICY_ID", "ROBOT_ID", "
|
|
188
|
+
"KEPT", "MOST_LAYERS", "PLANS_MOST", "STATE_MOST", "PLAN_ON_A_POLICY", "PLANNER_ID", "POLICY_ID", "ROBOT_ID", "WAITING_FOR_PLAN",
|
|
189
|
+
"PlannerSpec",
|
|
189
190
|
"PlannerRoundRequest", "PlannerRobot", "PlannerMember", "PlannerObservation", "PlannerPlanIn", "PlannerRound",
|
|
190
191
|
"PlannerPlans", "PlannerPlansWritten", "PlanAppend", "PlanAppended", "PlannerObserve", "PlannerObserved",
|
|
191
192
|
|
|
@@ -3,7 +3,7 @@ Contract 6 — accounts / secret / billing wire types.
|
|
|
3
3
|
|
|
4
4
|
Secret-leak rule, mechanically checkable (goal 15). Two kinds of secret:
|
|
5
5
|
(a) platform-minted — `direct_secret`, TLS private key. May appear in the DOWN direction only:
|
|
6
|
-
|
|
6
|
+
a connect's answer, BootstrapResponse.direct_secret + tls_key.
|
|
7
7
|
(b) user Secret-Manager values. May appear in the WRITE direction only:
|
|
8
8
|
SecretCreateRequest.env, BootstrapResponse.env (injected into the worker subprocess).
|
|
9
9
|
These four fields are the entire allow-list for carrying a plaintext secret value. Everything returned
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Contract 3 — a worker's lease, and the cold-start answer of a connect (control plane).
|
|
3
|
+
|
|
4
|
+
A connect's own body and answer are not here: the gateway reads the one by its model (routes/connect.py ConnectRequest)
|
|
5
|
+
and sequence-ai sends and reads a dict, and the classes kept here matched neither - no `session`, which it requires - and
|
|
6
|
+
were read by nothing. A lease is read by the worker's bootstrap (contract/accounts.py). The cold-start fallback is a
|
|
7
|
+
defined wire body, not an HTTP header alone — a 503 returns `WarmingError` (contract/errors.py), so `503 + Retry-After`
|
|
8
|
+
and the warming ETA are typed and checkable.
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
from datetime import datetime
|
|
13
|
+
from typing import Literal
|
|
14
|
+
|
|
15
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
from sequence_base.contract.errors import WarmingError
|
|
19
|
+
|
|
20
|
+
__all__ = ["Lease", "WarmingError"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Lease(BaseModel):
|
|
24
|
+
"""A time-boxed grant of the direct coordinates. Renewed before `expires_at`; `epoch` is the
|
|
25
|
+
worker/secret generation — a client holding a stale epoch against a new worker gets 401 and must
|
|
26
|
+
re-connect."""
|
|
27
|
+
|
|
28
|
+
model_config = ConfigDict(extra="forbid")
|
|
29
|
+
|
|
30
|
+
ttl_s: int
|
|
31
|
+
expires_at: datetime
|
|
32
|
+
epoch: int = Field(..., description="Worker/secret generation counter; rolls on worker change")
|
|
@@ -207,9 +207,6 @@ class DeploymentPolicy(BaseModel):
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
episodes: Episodes | None = None
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
streaming: bool = Field(default=False, exclude=True)
|
|
213
210
|
secrets: list[SecretRef] = Field(default_factory=list)
|
|
214
211
|
|
|
215
212
|
|
|
@@ -247,17 +244,6 @@ class DeploymentPolicy(BaseModel):
|
|
|
247
244
|
raise ValueError(PLAN_ON_A_POLICY)
|
|
248
245
|
return self
|
|
249
246
|
|
|
250
|
-
@model_validator(mode="after")
|
|
251
|
-
def _episodes_of_streaming(self) -> "DeploymentPolicy":
|
|
252
|
-
|
|
253
|
-
if self.streaming and self.episodes not in (None, "own"):
|
|
254
|
-
raise ValueError(f"streaming is what a record from before contract 0.5.24 says; beside "
|
|
255
|
-
f"episodes={self.episodes!r}, leave it out")
|
|
256
|
-
if self.streaming:
|
|
257
|
-
self.episodes = "own"
|
|
258
|
-
self.streaming = self.episodes == "own"
|
|
259
|
-
return self
|
|
260
|
-
|
|
261
247
|
@model_validator(mode="after")
|
|
262
248
|
def _plays_what_it_holds(self) -> "DeploymentPolicy":
|
|
263
249
|
check_chunk_lens(self.action_chunk_valid_len, self.action_chunk_replan_at)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"""
|
|
2
|
-
The observation stream:
|
|
3
|
-
|
|
2
|
+
The observation stream: every observation a robot makes is sent to its worker as it is made (POST /observe), and its
|
|
3
|
+
act carries none.
|
|
4
4
|
|
|
5
5
|
In one sentence: the robot's SDK numbers each observation of an episode from 0 → posts them as they come, each post the
|
|
6
|
-
ones that came while the last was on its way (ObserveRequest) → the worker keeps them by episode
|
|
7
|
-
|
|
8
|
-
worker waits for
|
|
9
|
-
the act's own last - what an eval's since_last_act sends in one act today.
|
|
6
|
+
ones that came while the last was on its way (ObserveRequest) → the worker keeps them by episode, answers how far it has
|
|
7
|
+
every one (ObserveResponse.through) and hands each to the policy in order → an act names how many came before it
|
|
8
|
+
(ActRequest.seq) → the worker waits for those to reach the policy, STREAM_WAIT_S at most, then calls its act function.
|
|
10
9
|
|
|
11
10
|
WHY: an act was the only upload, so every frame between two acts waited for the next one - 24 frames, 1304 KB and a read
|
|
12
11
|
p50 of 425 ms from a robot at home. Sent as they are made, they
|
|
@@ -23,23 +22,7 @@ from typing import Any
|
|
|
23
22
|
|
|
24
23
|
from pydantic import BaseModel, ConfigDict, Field
|
|
25
24
|
|
|
26
|
-
__all__ = ["
|
|
27
|
-
"ObserveResponse", "ZSTD_FORMAT"]
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
FORMAT = "x-seq-observe/1"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ZSTD_FORMAT = "x-seq-zstd/1"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
BLOCKS_FORMAT = "x-seq-blocks/1"
|
|
25
|
+
__all__ = ["FRAMES_MISSING", "FRAMES_OVER_LIMIT", "ObserveFrame", "ObserveRequest", "ObserveResponse"]
|
|
43
26
|
|
|
44
27
|
|
|
45
28
|
|
|
@@ -68,7 +51,6 @@ class ObserveRequest(BaseModel):
|
|
|
68
51
|
skipped: list[int] = Field(default_factory=list, description="Numbers left out on purpose, never to come")
|
|
69
52
|
|
|
70
53
|
|
|
71
|
-
|
|
72
54
|
blocks: dict[bytes, Any] = Field(default_factory=dict,
|
|
73
55
|
description="Block contents by id, for the references in the frames")
|
|
74
56
|
|
|
@@ -16,13 +16,7 @@ from typing import Any
|
|
|
16
16
|
|
|
17
17
|
from pydantic import BaseModel, ConfigDict
|
|
18
18
|
|
|
19
|
-
__all__ = ["
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
OBSERVATIONS_GONE = ("observations= is gone: a policy is handed every observation as its robot sends it - keep the ones "
|
|
24
|
-
"an act reads in an @seq.observe method (on self, or in episode.state), and deploy again with the "
|
|
25
|
-
"latest sequence-ai")
|
|
19
|
+
__all__ = ["Tensors", "rows_of"]
|
|
26
20
|
|
|
27
21
|
|
|
28
22
|
class Tensors(BaseModel):
|
|
@@ -49,9 +49,8 @@ STATE_MOST = 256 * 1024
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
|
+
WAITING_FOR_PLAN = "waiting_for_plan"
|
|
52
53
|
|
|
53
|
-
TEAM_GONE = ("team is gone: a team is a planner now - @seq.planner(members=[...]) names the policies policies= named, "
|
|
54
|
-
"and planners too; a robot connects to its own policy as ever, and deploy again with the latest sequence-ai")
|
|
55
54
|
|
|
56
55
|
|
|
57
56
|
PLAN_ON_A_POLICY = ("@seq.plan is a planner's now: a policy is planned by a @seq.planner that names it in members= - "
|
|
@@ -385,10 +385,6 @@ class PolicySpec(BaseModel):
|
|
|
385
385
|
|
|
386
386
|
|
|
387
387
|
|
|
388
|
-
streaming: bool = Field(default=False, exclude=True)
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
388
|
|
|
393
389
|
|
|
394
390
|
|
|
@@ -428,17 +424,6 @@ class PolicySpec(BaseModel):
|
|
|
428
424
|
check_weights_uri(uri, f"weights[{name!r}]")
|
|
429
425
|
return self
|
|
430
426
|
|
|
431
|
-
@model_validator(mode="after")
|
|
432
|
-
def _episodes_of_streaming(self) -> "PolicySpec":
|
|
433
|
-
|
|
434
|
-
if self.streaming and self.episodes not in (None, "own"):
|
|
435
|
-
raise ValueError(f"streaming is what a record from before contract 0.5.24 says; beside "
|
|
436
|
-
f"episodes={self.episodes!r}, leave it out")
|
|
437
|
-
if self.streaming:
|
|
438
|
-
self.episodes = "own"
|
|
439
|
-
self.streaming = self.episodes == "own"
|
|
440
|
-
return self
|
|
441
|
-
|
|
442
427
|
@model_validator(mode="after")
|
|
443
428
|
def _plays_what_it_holds(self) -> "PolicySpec":
|
|
444
429
|
check_chunk_lens(self.action_chunk_valid_len, self.action_chunk_replan_at)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The /act wire, version 2 — opaque. The platform carries a policy's inputs and outputs; it never reads them.
|
|
3
|
+
|
|
4
|
+
In one sentence: the robot's own code (a template's `client.py`) preprocesses raw sensor data into observations → the SDK
|
|
5
|
+
posts each to the worker as it is made (POST /observe, contract.observe) → a robot's act is L0's call, which carries no
|
|
6
|
+
data and names how many observations came before it → the worker hands the policy every one of them, unchanged, then
|
|
7
|
+
calls its act function → whatever that returns comes back as `outputs`, unchanged. The platform's own acts (a worker's
|
|
8
|
+
warm-up, its build's check) carry their `inputs` instead, handed to infer() unchanged. What the observations and
|
|
9
|
+
`outputs` hold is agreed between the two halves of the user's own code, never by the platform.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Alongside the payload the envelope carries only what the platform itself acts on: a seed (determinism), the episode
|
|
13
|
+
(per-episode state and `/act/episode_end`) and the declared inference parameters.
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from typing import Any, Literal
|
|
18
|
+
|
|
19
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
20
|
+
|
|
21
|
+
__all__ = ["ActRequest", "ActResponse"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ActRequest(BaseModel):
|
|
25
|
+
"""POST /act, version 2: a robot's act is a call ({"call": "act"}), which carries no `inputs`; the platform's own act
|
|
26
|
+
carries `inputs`, any JSON value the worker does not inspect."""
|
|
27
|
+
|
|
28
|
+
model_config = ConfigDict(extra="forbid")
|
|
29
|
+
|
|
30
|
+
call: Literal["act"] | None = Field(default=None, description="\"act\": L0's act, which carries no inputs")
|
|
31
|
+
inputs: Any = Field(default=None, description="Whatever the policy's infer() takes, exactly as the code built it; "
|
|
32
|
+
"none in a call")
|
|
33
|
+
seed: int | None = Field(default=None, description="Sampling seed, passed to infer() for a reproducible answer")
|
|
34
|
+
episode_id: str | None = Field(default=None, description="The episode this call belongs to (per-episode state)")
|
|
35
|
+
params: dict[str, Any] | None = Field(default=None,
|
|
36
|
+
description="Values for the inference parameters the policy declares")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
seq: int | None = Field(default=None, ge=0,
|
|
40
|
+
description="A call's: how many observations its episode sent before it (POST /observe)")
|
|
41
|
+
|
|
42
|
+
@model_validator(mode="after")
|
|
43
|
+
def _a_call_or_inputs(self) -> "ActRequest":
|
|
44
|
+
"""A call carries no inputs, and an act that is no call carries them, as a worker reads its body."""
|
|
45
|
+
if self.call is not None and "inputs" in self.model_fields_set:
|
|
46
|
+
raise ValueError("an act carries no data: send it with observe(x), then act()")
|
|
47
|
+
if self.call is None and "inputs" not in self.model_fields_set:
|
|
48
|
+
raise ValueError('an act\'s body is {"inputs": ...}, or {"call": "act"}')
|
|
49
|
+
return self
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class ActResponse(BaseModel):
|
|
53
|
+
"""200 from /act, version 2. `outputs` is infer()'s return value, unchanged; the rest is platform metadata."""
|
|
54
|
+
|
|
55
|
+
model_config = ConfigDict(extra="forbid")
|
|
56
|
+
|
|
57
|
+
outputs: Any = Field(..., description="infer()'s return value, exactly as the policy returned it")
|
|
58
|
+
perf: dict[str, Any] | None = Field(default=None, description="Per-phase timings of this call")
|
|
59
|
+
usage: dict[str, Any] | None = Field(default=None, description="What this call counted towards the account")
|
|
60
|
+
request_id: str | None = Field(default=None, description="This call's id; quote it when reporting a problem")
|
|
@@ -5,13 +5,9 @@ Written in plain Python, so neither a worker nor a client installs a msgpack pac
|
|
|
5
5
|
|
|
6
6
|
In one sentence: a client takes the act's envelope ({"inputs", "seed", "episode_id", "params", ...}) → `pack` writes it
|
|
7
7
|
as msgpack, each numpy array as the map msgpack-numpy writes ({"nd": True, "type", "kind", "shape", "data"}) → a worker
|
|
8
|
-
|
|
9
|
-
JSON act; an answer asked for in msgpack (Accept: MEDIA_TYPE) comes back the same way - its arrays, to a client
|
|
8
|
+
`unpack`s it back to the same dict, arrays as arrays, and serves it as it serves a JSON act; an answer asked for in msgpack (Accept: MEDIA_TYPE) comes back the same way - its arrays, to a client
|
|
10
9
|
without numpy, as the lists their tolist() gives, what the answer in JSON holds.
|
|
11
10
|
|
|
12
|
-
WHY a media type of its own: a worker reads a body that is not JSON as the policy's own inputs and hands it on
|
|
13
|
-
untouched - an `application/msgpack` body included, which some policies decode themselves - so a client sends this
|
|
14
|
-
type only to a worker that says it reads it.
|
|
15
11
|
WHY both array layouts are read: the two ecosystems that send numpy over msgpack write arrays differently -
|
|
16
12
|
msgpack-numpy as {"nd", "type", "kind", "shape", "data"}, openpi as {"__ndarray__", "data", "dtype", "shape"} - and a
|
|
17
13
|
policy's own client may use either. {XPolicyLab 5d0be14 client_server/ws/protocol/codec.py "msgpack_numpy.encode";
|
|
@@ -30,12 +26,10 @@ import struct
|
|
|
30
26
|
import sys
|
|
31
27
|
from typing import Any, NamedTuple
|
|
32
28
|
|
|
33
|
-
__all__ = ["
|
|
29
|
+
__all__ = ["MAX_DEPTH", "MEDIA_TYPE", "MsgpackError", "pack", "unpack"]
|
|
34
30
|
|
|
35
31
|
MEDIA_TYPE = "application/x-seq-msgpack"
|
|
36
32
|
|
|
37
|
-
FORMAT = "x-seq-msgpack/1"
|
|
38
|
-
|
|
39
33
|
MAX_DEPTH = 64
|
|
40
34
|
|
|
41
35
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The top-level keys of an observation that say what a robot should do. An observation is the user's own and the platform
|
|
3
|
+
reads none of it, but for a robot connected through a planner: its worker keeps these from its policy's code and hands
|
|
4
|
+
them to the planner, whose plans are all the policy is told. Other
|
|
5
|
+
names, nested keys and words in an image are the policy's own to leave alone. The same keys `seq data` reads an
|
|
6
|
+
episode's task under.
|
|
7
|
+
|
|
8
|
+
"""
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
PROMPT_KEYS = ("instruction", "task", "prompt", "language_instruction")
|
|
@@ -32,7 +32,7 @@ from sequence_base.contract.benchmarks import (
|
|
|
32
32
|
BenchmarkSpec,
|
|
33
33
|
ReplaySpec,
|
|
34
34
|
)
|
|
35
|
-
from sequence_base.contract.connect import
|
|
35
|
+
from sequence_base.contract.connect import Lease
|
|
36
36
|
from sequence_base.contract.observe import ObserveRequest, ObserveResponse
|
|
37
37
|
from sequence_base.contract.wire import ActRequest, ActResponse
|
|
38
38
|
from sequence_base.contract.deployments import (
|
|
@@ -166,9 +166,6 @@ WIRE_MODELS: dict[str, type[BaseModel]] = {
|
|
|
166
166
|
"SettingsChanged": SettingsChanged,
|
|
167
167
|
|
|
168
168
|
"Lease": Lease,
|
|
169
|
-
"ConnectRequest": ConnectRequest,
|
|
170
|
-
"ConnectResponse": ConnectResponse,
|
|
171
|
-
"Standby": Standby,
|
|
172
169
|
|
|
173
170
|
"ReplaySpec": ReplaySpec,
|
|
174
171
|
"BenchmarkSpec": BenchmarkSpec,
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"additionalProperties": false,
|
|
3
|
-
"description": "POST /act, version 2
|
|
3
|
+
"description": "POST /act, version 2: a robot's act is a call ({\"call\": \"act\"}), which carries no `inputs`; the platform's own act\ncarries `inputs`, any JSON value the worker does not inspect.",
|
|
4
4
|
"properties": {
|
|
5
|
+
"call": {
|
|
6
|
+
"anyOf": [
|
|
7
|
+
{
|
|
8
|
+
"const": "act",
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "null"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"default": null,
|
|
16
|
+
"description": "\"act\": L0's act, which carries no inputs",
|
|
17
|
+
"title": "Call"
|
|
18
|
+
},
|
|
5
19
|
"episode_id": {
|
|
6
20
|
"anyOf": [
|
|
7
21
|
{
|
|
@@ -16,7 +30,8 @@
|
|
|
16
30
|
"title": "Episode Id"
|
|
17
31
|
},
|
|
18
32
|
"inputs": {
|
|
19
|
-
"
|
|
33
|
+
"default": null,
|
|
34
|
+
"description": "Whatever the policy's infer() takes, exactly as the code built it; none in a call",
|
|
20
35
|
"title": "Inputs"
|
|
21
36
|
},
|
|
22
37
|
"params": {
|
|
@@ -57,13 +72,10 @@
|
|
|
57
72
|
}
|
|
58
73
|
],
|
|
59
74
|
"default": null,
|
|
60
|
-
"description": "
|
|
75
|
+
"description": "A call's: how many observations its episode sent before it (POST /observe)",
|
|
61
76
|
"title": "Seq"
|
|
62
77
|
}
|
|
63
78
|
},
|
|
64
|
-
"required": [
|
|
65
|
-
"inputs"
|
|
66
|
-
],
|
|
67
79
|
"title": "ActRequest",
|
|
68
80
|
"type": "object",
|
|
69
81
|
"x-contract-version": "0.5.38"
|
|
@@ -46,14 +46,6 @@
|
|
|
46
46
|
"default": null,
|
|
47
47
|
"description": "What this call counted towards the account",
|
|
48
48
|
"title": "Usage"
|
|
49
|
-
},
|
|
50
|
-
"warnings": {
|
|
51
|
-
"description": "Non-fatal notes, e.g. actions clipped into bounds",
|
|
52
|
-
"items": {
|
|
53
|
-
"type": "string"
|
|
54
|
-
},
|
|
55
|
-
"title": "Warnings",
|
|
56
|
-
"type": "array"
|
|
57
49
|
}
|
|
58
50
|
},
|
|
59
51
|
"required": [
|