ritvik360 commited on
Commit
46e0615
Β·
verified Β·
1 Parent(s): 1a16689

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. server/environment.py +5 -5
server/environment.py CHANGED
@@ -152,7 +152,7 @@ class NL2SQLEnvironment(Environment):
152
  self._last_obs = obs
153
  return obs
154
 
155
- def step(self, action: NL2SQLAction) -> tuple[NL2SQLObservation, float, bool, dict]:
156
  """Execute the agent's SQL and return graded observation."""
157
  if self._task is None or self._example is None:
158
  # Called before reset β€” auto-reset
@@ -212,9 +212,9 @@ class NL2SQLEnvironment(Environment):
212
  )
213
  self._last_obs = obs
214
 
215
- # CRITICAL FIX: Return the 4-part OpenEnv tuple!
216
- info = {"score": score, "error": error}
217
- return obs, reward, done, info
218
 
219
  @property
220
  def state(self) -> NL2SQLState:
@@ -223,4 +223,4 @@ class NL2SQLEnvironment(Environment):
223
  # ── Helpers ────────────────────────────────────────────────────────────
224
 
225
  def available_tasks(self) -> list:
226
- return all_task_names()
 
152
  self._last_obs = obs
153
  return obs
154
 
155
+ def step(self, action: NL2SQLAction) -> NL2SQLObservation:
156
  """Execute the agent's SQL and return graded observation."""
157
  if self._task is None or self._example is None:
158
  # Called before reset β€” auto-reset
 
212
  )
213
  self._last_obs = obs
214
 
215
+ # openenv-core expects ONLY the observation returned from step().
216
+ # The framework reads obs.reward and obs.done itself β€” do NOT return a tuple.
217
+ return obs
218
 
219
  @property
220
  def state(self) -> NL2SQLState:
 
223
  # ── Helpers ────────────────────────────────────────────────────────────
224
 
225
  def available_tasks(self) -> list:
226
+ return all_task_names()