Escanor925 commited on
Commit
b800af2
·
1 Parent(s): 38a3cf7

fix: make reset endpoint body optional for automated judge

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -218,13 +218,14 @@ def health_check():
218
 
219
 
220
  @app.post("/reset", response_model=ResetResponse, tags=["environment"])
221
- def reset_env(req: ResetRequest):
222
  """
223
  Initialize a new episode for the given task difficulty and return the
224
  first Observation the agent will see.
225
  """
226
  try:
227
- obs = env.reset(req.task_name)
 
228
  return ResetResponse(
229
  status=200,
230
  observation=obs.model_dump(),
 
218
 
219
 
220
  @app.post("/reset", response_model=ResetResponse, tags=["environment"])
221
+ def reset_env(req: Optional[ResetRequest] = None):
222
  """
223
  Initialize a new episode for the given task difficulty and return the
224
  first Observation the agent will see.
225
  """
226
  try:
227
+ task_name = req.task_name if req is not None else "easy"
228
+ obs = env.reset(task_name)
229
  return ResetResponse(
230
  status=200,
231
  observation=obs.model_dump(),