wordle / models.py
NeerjaK's picture
Upload folder using huggingface_hub
255b011 verified
Raw History Blame Contribute Delete
1.2 kB
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
Data models for the Wordle Environment.
The wordle environment is a simple test environment that echoes back messages.
"""
from openenv.core.env_server.types import Action, Observation
from pydantic import Field
class WordleAction(Action):
"""Action for the Wordle environment - guess the 5 letter word."""
guess: str = Field(..., description="Guess the 5 letter word")
class WordleObservation(Observation):
"""Observation from the Wordle environment - the echoed message."""
attempts_left: int = Field(default=6, description="Number of attempts left")
is_win: bool = Field(default=False, description="Whether the word has been guessed")
feedback: list[str] = Field(default_factory=list, description="Feedback for each letter")
message: str = Field(default="", description="Message to echo back")
reward: float = Field(default=0.0, description="Reward for the step")
done: bool = Field(default=False, description="Whether the episode is done")