rust_coder / models.py
Parthiban007's picture
Upload folder using huggingface_hub
7bc8744 verified
raw
history blame
1.47 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 Rust Coder Environment.
The rust_coder environment is a simple test environment that echoes back messages.
"""
from openenv.core.env_server.types import Action, Observation
from pydantic import Field
class RustCoderAction(Action):
"""Action for the Rust Coder environment - contains the Rust code to evaluate."""
code: str = Field(default="", description="Rust source code to compile and run")
class RustCoderObservation(Observation):
"""Observation space for the Rust Coder environment."""
problem_description: str = Field(default="", description="The text description of the current coding task, including requirements.")
starter_code: str = Field(default="", description="The specific Rust code snippet that needs fixing for this task.")
compilation_success: bool = Field(default=False, description="Binary flag indicating if the last submission compiled.")
compilation_output: str = Field(default="", description="Raw stdout/stderr from the rustc compiler.")
test_results: list[dict] = Field(default_factory=list, description="A list of results from automated test assertions.")
reward_breakdown: dict = Field(default_factory=dict, description="Detailed components of the 0.0-1.0 reward.")