Download source/five_desks/models.py from rca-umb/five-desks: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/datasets/rca-umb/five-desks/resolve/main/source/five_desks/models.py
- Command line
-
hf download hf://datasets/rca-umb/five-desks/source/five_desks/models.py
-
curl -L -o models.py https://huggingface.co/datasets/rca-umb/five-desks/resolve/main/source/five_desks/models.py
1.3 kB
| """Action and observation models for Five Desks.""" | |
| from typing import Any, Literal | |
| from openenv.core.env_server.types import Action, Observation | |
| from pydantic import ConfigDict, Field | |
| class DeskAction(Action): | |
| # Unknown keys are ignored instead of failing the whole episode. | |
| model_config = ConfigDict(extra="ignore", validate_assignment=True) | |
| tool: Literal["list", "read", "calc", "submit"] = Field( | |
| description=( | |
| "list: show the workspace files. read: show one file (needs path). " | |
| "calc: evaluate one arithmetic expression (needs expr). " | |
| "submit: send the final answer (needs answer); this ends the episode." | |
| ) | |
| ) | |
| path: str = Field(default="", max_length=200, description="File name for read.") | |
| expr: str = Field( | |
| default="", | |
| max_length=1000, | |
| description="Arithmetic expression for calc, e.g. 1250*(1+0.04/12)**36.", | |
| ) | |
| answer: dict[str, Any] = Field( | |
| default_factory=dict, | |
| description="For submit: an object with exactly the answer keys the task asks for.", | |
| ) | |
| class DeskObservation(Observation): | |
| output: str = Field(default="", description="Result of the last action.") | |
| steps_left: int = Field(default=0, description="Actions left before the episode ends.") | |