File size: 1,388 Bytes
a8211b4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a553bf0
 
a8211b4
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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 AutoMathReasoner Environment.
"""

from typing import List, Dict, Any
from pydantic import Field
from openenv.core.env_server.types import Action, Observation

class AutomathreasonerAction(Action):
    """Action for the AutoMathReasoner environment - containing reasoning and final answer."""

    reasoning: str = Field(default="", description="The step-by-step mathematical reasoning.")
    final_answer: str = Field(default="", description="The final numerical or algebraic answer.")


class AutomathreasonerObservation(Observation):
    """Observation from the AutoMathReasoner environment."""

    problem_text: str = Field(default="", description="The text of the generated math problem.")
    difficulty_level: float = Field(default=1.0, description="The current difficulty level of the problem.")
    history: List[Dict[str, Any]] = Field(default_factory=list, description="History of the last 3 attempts for this problem.")
    
    # Required by OpenEnv base class
    reward: float = Field(default=0.0, description="Reward received from the previous action.")
    done: bool = Field(default=False, description="Whether the episode has ended.")