Download models.py from Prithvigg/wordgame: direct link, hf CLI and curl.
- Browser
- Download file 973 Bytes
-
https://huggingface.co/spaces/Prithvigg/wordgame/resolve/main/models.py
- Command line
-
hf download hf://spaces/Prithvigg/wordgame/models.py
-
curl -L -o models.py https://huggingface.co/spaces/Prithvigg/wordgame/resolve/main/models.py
973 Bytes
| from typing import List, Optional, Dict, Any | |
| from openenv.core.env_server.types import Action, Observation, State | |
| from pydantic import Field | |
| class WordGameAction(Action): | |
| """Player guesses a single letter.""" | |
| guess: str = Field(..., description="A single letter guessed by the player") | |
| class WordGameObservation(Observation): | |
| """What the player sees after each guess.""" | |
| masked_word: str = Field(default="", description="Word with unguessed letters masked, e.g. 'p_th_n'") | |
| guessed_letters: List[str] = Field(default_factory=list, description="All letters tried") | |
| attempts_remaining: int = Field(default=6, description="Number of wrong guesses remaining") | |
| message: str = Field(default="", description="Feedback text") | |
| class WordGameState(State): | |
| """Episode metadata.""" | |
| target_word: str = Field(default="", description="The word to be guessed") | |
| max_attempts: int = Field(default=6, description="Maximum wrong guesses allowed") | |