crossdomain-env / env /models.py
cmpatino's picture
cmpatino HF Staff
CrossDomain Reasoning OpenEnv environment v1
373eaff verified
Raw History Blame Contribute Delete
1.14 kB
# SPDX-License-Identifier: BSD-3-Clause
"""Action and observation models for the CrossDomain Reasoning environment."""
from typing import Literal
from openenv.core.env_server.types import Action, Observation
from pydantic import Field
class CrossDomainAction(Action):
"""One move: run Python code as a scratchpad, or submit the final answer."""
tool: Literal["python", "submit"] = Field(
...,
description=(
"'python' runs `input` as a Python 3 script and returns its stdout/stderr; "
"'submit' ends the episode with `input` as the final answer."
),
)
input: str = Field(
...,
description="Python source code for 'python', or the final answer text for 'submit'.",
)
class CrossDomainObservation(Observation):
"""What the agent sees after reset or a step."""
task: str = Field(default="", description="The problem statement (reset only).")
output: str = Field(default="", description="Output of the last tool call, or grading feedback.")
steps_left: int = Field(default=0, description="Tool calls left before the episode is cut off.")