plancraft 0.4.0__py3-none-any.whl → 0.4.1__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.
- plancraft/simple.py +15 -2
- {plancraft-0.4.0.dist-info → plancraft-0.4.1.dist-info}/METADATA +1 -1
- {plancraft-0.4.0.dist-info → plancraft-0.4.1.dist-info}/RECORD +5 -5
- {plancraft-0.4.0.dist-info → plancraft-0.4.1.dist-info}/WHEEL +0 -0
- {plancraft-0.4.0.dist-info → plancraft-0.4.1.dist-info}/licenses/LICENSE +0 -0
plancraft/simple.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import json
|
2
2
|
import os
|
3
|
-
from typing import Any
|
3
|
+
from typing import Any, Optional
|
4
4
|
|
5
5
|
from plancraft.config import PlancraftExample
|
6
6
|
from plancraft.environment.actions import (
|
@@ -86,7 +86,7 @@ class PlancraftGymWrapper:
|
|
86
86
|
return f"Only select actions from the following: {', '.join(action_names)}"
|
87
87
|
|
88
88
|
def step(
|
89
|
-
self, action: str
|
89
|
+
self, action: Optional[str] = None
|
90
90
|
) -> tuple[dict[str, Any], float, bool, bool, dict[str, Any]]:
|
91
91
|
"""
|
92
92
|
Execute action and return next observation, reward, termination status, truncation status, and info
|
@@ -102,6 +102,19 @@ class PlancraftGymWrapper:
|
|
102
102
|
truncated: Whether the episode is done due to external limits (e.g. max steps reached)
|
103
103
|
info: Additional diagnostic information (helpful for debugging)
|
104
104
|
"""
|
105
|
+
# Handle initial step
|
106
|
+
if not action:
|
107
|
+
observation = self.environment.step()
|
108
|
+
observation["target"] = self.example.target
|
109
|
+
if self.use_text_inventory:
|
110
|
+
text = target_and_inventory_to_text_obs(
|
111
|
+
target=self.example.target, inventory=observation["inventory"]
|
112
|
+
)
|
113
|
+
else:
|
114
|
+
text = get_objective_str(self.example.target)
|
115
|
+
observation["text"] = text
|
116
|
+
return observation, 0.0, False, False, {"steps": self.current_step}
|
117
|
+
|
105
118
|
action = self.parse_raw_model_response(action)
|
106
119
|
self.current_step += 1
|
107
120
|
|
@@ -2,7 +2,7 @@ plancraft/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
plancraft/config.py,sha256=oyn8I_k0Slh-Nyg2javomFertZ5ZHiY_ndAVqfJYQvQ,4010
|
3
3
|
plancraft/evaluator.py,sha256=UQujiltf88rCnbNwoglM5tJe5gW9XASew-jLaEbtJZo,15525
|
4
4
|
plancraft/generate_dataset.py,sha256=DlrU-PmvWqSNJD1g1-8Lpb8n3N-Ogw3rje1nrRzjGKs,2382
|
5
|
-
plancraft/simple.py,sha256=
|
5
|
+
plancraft/simple.py,sha256=7D_SVT2sbXLnHA98P2E_nxV5VPBKbNpij4hB2ArURxA,7329
|
6
6
|
plancraft/utils.py,sha256=hCE1oQ-77Me39Vo-sCL7iZPdO-WWYZnBjP41lZWRi20,6339
|
7
7
|
plancraft/data/test.json,sha256=4jWfYMAVuZCFmGB4iZJAjlh9_8jXECdaGp8xn7_tAM4,1317131
|
8
8
|
plancraft/data/test.small.easy.json,sha256=5NZEJ2PqIgmHQecJOIVQyM1D6GFKyJq7GVmgRudaqQk,189304
|
@@ -1921,7 +1921,7 @@ plancraft/models/generators.py,sha256=7COMLjjx_HbTWJqINNLqqExQv7gLikfLTViacAdSt5
|
|
1921
1921
|
plancraft/models/oracle.py,sha256=f-0KWlBuHy6wcxmDsxM3MQ_QwfBstzfbA26mlk1MgLA,1657
|
1922
1922
|
plancraft/models/utils.py,sha256=xgkP5jqCeFfkKe3Xd4ZYfTqiEJ-dA-qgFAC-J35ub3E,4029
|
1923
1923
|
plancraft/train/dataset.py,sha256=oFqEd4LG9oEQ-71teh0Wf7-jJbtybT2ZibfM2bBdBkM,5474
|
1924
|
-
plancraft-0.4.
|
1925
|
-
plancraft-0.4.
|
1926
|
-
plancraft-0.4.
|
1927
|
-
plancraft-0.4.
|
1924
|
+
plancraft-0.4.1.dist-info/METADATA,sha256=ihEDlnWWbtQYFNLiTWD2Refq0CvRDd7Rv4wOs7LWMhQ,12391
|
1925
|
+
plancraft-0.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
1926
|
+
plancraft-0.4.1.dist-info/licenses/LICENSE,sha256=YGR8ehDB4t-T-lOQKMfKNR-2zsOU7E3E5NA8t25HKE0,1070
|
1927
|
+
plancraft-0.4.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|