File size: 2,318 Bytes
dd8b2b6
 
 
 
 
 
 
 
 
 
 
 
 
5371126
dd8b2b6
 
 
 
 
 
 
 
 
 
 
 
 
c13be93
0ad3f8a
c13be93
 
 
 
 
dd8b2b6
 
 
9937e76
 
 
 
 
 
 
 
e0b43d0
 
 
 
 
9937e76
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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 Edupilot Environment.



The EduPilot environment is a simple test environment that echoes back messages.

"""

from openenv.core.env_server.types import Action, Observation
from pydantic import BaseModel, Field


class EdupilotAction(Action):
    """Action for the Edupilot environment - just a message to echo."""

    message: str = Field(..., description="Message to echo back")


class EdupilotObservation(Observation):
    """Observation from the Edupilot environment - the echoed message."""

    echoed_message: str = Field(default="", description="The echoed message")
    message_length: int = Field(default=0, description="Length of the echoed message")
    goal: str = Field(
        default="Create a reminder email notification object in JSON format exactly matching the required schema and expected values",
        description="Goal of the agent to perform",
    )
    last_action_error: bool = Field(
        default=False, description="whether there was last action error"
    )
    reward_observations: list = Field(
        default=[], description="Observations for what was rewarded and by what"
    )
    success_ratio: float = Field(
        default=0.0, description="Success ratio against the benchmark"
    )
    mean_performance: float = Field(
        default=0.0, description="Mean performance of the agent"
    )


class EdupilotRewards(BaseModel):
    total_reward: float = Field(default=0.0, description="Total rewards collected")
    reward_observations: list = Field(default={}, description="Observations for what was rewarded and by what")


class EdupilotMetrics(BaseModel):
    benchmark: float = Field(
        default=0.0, description="Benchmark to evaluate results against"
    )
    current_reward: float = Field(default=0.0, description="Current total reward")
    success_ratio: float = Field(
        default=0.0, description="Success ratio against the benchmark"
    )
    mean_performance: float = Field(
        default=0.0, description="Mean performance of the agent/model"
    )