plancraft 0.4.0__py3-none-any.whl → 0.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.
@@ -155,7 +155,9 @@ def construct_example(
155
155
 
156
156
  optimal_path = optimal_planner(target, inventory)
157
157
  # @TODO this is a hack to ensure that we don't have impossible examples
158
- while optimal_path is not None and impossible:
158
+ while (optimal_path is not None and impossible) or (
159
+ optimal_path is None and not impossible
160
+ ):
159
161
  inventory = remove_ancestor_items(target, inventory)
160
162
  optimal_path = optimal_planner(target, inventory)
161
163
 
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plancraft
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Plancraft: an evaluation dataset for planning with LLM agents
5
5
  License: MIT License
6
6
 
@@ -2,12 +2,15 @@ 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=QlXsCd6n5lIaehSFjeBlxTm40FuGCGHPEEsuGIMEJqk,6745
5
+ plancraft/simple.py,sha256=7D_SVT2sbXLnHA98P2E_nxV5VPBKbNpij4hB2ArURxA,7329
6
6
  plancraft/utils.py,sha256=hCE1oQ-77Me39Vo-sCL7iZPdO-WWYZnBjP41lZWRi20,6339
7
+ plancraft/data/test.curriculum.json,sha256=_mqIqwcmRCcgVA5fOKK27-y3sJdsW86nEqa6ATdyTeA,875349
7
8
  plancraft/data/test.json,sha256=4jWfYMAVuZCFmGB4iZJAjlh9_8jXECdaGp8xn7_tAM4,1317131
8
9
  plancraft/data/test.small.easy.json,sha256=5NZEJ2PqIgmHQecJOIVQyM1D6GFKyJq7GVmgRudaqQk,189304
9
10
  plancraft/data/test.small.json,sha256=eULAG1rdolRMXPrecV-7YoDIheKGyIT5MVpWdISV0wg,270089
11
+ plancraft/data/train.curriculum.json,sha256=eOfGusDtGG1BBvTJdzjUdhTHVAfFro_vGyYgKzZuxvE,1787758
10
12
  plancraft/data/train.json,sha256=asZIFnkBdgupPKRXacM4J0Ngt21B2BrMT6oPgFA96HI,2697710
13
+ plancraft/data/val.curriculum.json,sha256=fso4S2g0kqMk7Ehz6ObQmJHk4wq0gAD2YQm0R8Nb95E,866889
11
14
  plancraft/data/val.json,sha256=IToAiaqUNQi_xhX1bzmInuskLaT7C2ryQjP-CZkzL24,1304403
12
15
  plancraft/data/val.small.easy.json,sha256=9zEmqepjXG2NIp88xnFqOCkwsUsku3HEwHoQGxgTr6U,190252
13
16
  plancraft/data/val.small.json,sha256=76E9EFaljDQyAokg97e-IblvcOe6KbrdKkXvRxhhkgo,237653
@@ -18,7 +21,7 @@ plancraft/environment/items.py,sha256=Z9rhSyVDEoHF1pxRvhyiT94tyQJaWHi3wUHVcamz82
18
21
  plancraft/environment/planner.py,sha256=uIOJjIoyT_4pxeWeTKb8BkLJyKZG0-AMoEOkZs6Ua9A,19340
19
22
  plancraft/environment/prompts.py,sha256=NU9YHAz3id-IgaukQvEi5uLlpEstpE5_Hccvvq1At2Y,6950
20
23
  plancraft/environment/recipes.py,sha256=0vwzOU86eZmGN2EpZVSIvzxpx0AOBWNPxTtAOFBN2A0,19570
21
- plancraft/environment/sampler.py,sha256=79hLpTU0ajvMPoBsvSe8tE88x31c8Vlczb3tJZJcau0,7441
24
+ plancraft/environment/sampler.py,sha256=F9_lI6cyg79HkeSLJVyvh9yZkT-B9PlJWyqaoAfAhwY,7502
22
25
  plancraft/environment/search.py,sha256=z31eEwQBY7WJaYVBEEwulFS8P3h1Nwo1Th9BaCTxk5M,2085
23
26
  plancraft/environment/assets/constants.json,sha256=kyOIOh82CTTMMGEIS60k5k6M-6fkEmYDoGAnvi3Zx5k,1379016
24
27
  plancraft/environment/assets/minecraft_font.ttf,sha256=AzoK9cgggXwjFPHtIO7uz-YaDrminl3nvB-VsaTvTAk,60992
@@ -1921,7 +1924,7 @@ plancraft/models/generators.py,sha256=7COMLjjx_HbTWJqINNLqqExQv7gLikfLTViacAdSt5
1921
1924
  plancraft/models/oracle.py,sha256=f-0KWlBuHy6wcxmDsxM3MQ_QwfBstzfbA26mlk1MgLA,1657
1922
1925
  plancraft/models/utils.py,sha256=xgkP5jqCeFfkKe3Xd4ZYfTqiEJ-dA-qgFAC-J35ub3E,4029
1923
1926
  plancraft/train/dataset.py,sha256=oFqEd4LG9oEQ-71teh0Wf7-jJbtybT2ZibfM2bBdBkM,5474
1924
- plancraft-0.4.0.dist-info/METADATA,sha256=Tt3DlKXtDxZ0M6s2zlEXydCB5dmxkeKI80wao62e-z4,12391
1925
- plancraft-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1926
- plancraft-0.4.0.dist-info/licenses/LICENSE,sha256=YGR8ehDB4t-T-lOQKMfKNR-2zsOU7E3E5NA8t25HKE0,1070
1927
- plancraft-0.4.0.dist-info/RECORD,,
1927
+ plancraft-0.4.2.dist-info/METADATA,sha256=OMyTZhI_6V_7geLfA1i7g3sJTB9dh6LKZB76Ys3aqLY,12391
1928
+ plancraft-0.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
1929
+ plancraft-0.4.2.dist-info/licenses/LICENSE,sha256=YGR8ehDB4t-T-lOQKMfKNR-2zsOU7E3E5NA8t25HKE0,1070
1930
+ plancraft-0.4.2.dist-info/RECORD,,