File size: 1,764 Bytes
bd67f06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Action and Observation models for the SimLab HR environment."""

from __future__ import annotations

from typing import Literal

from pydantic import Field

from openenv.core.env_server.types import Action, Observation

TOOL_SERVERS = ("hrms", "email", "calendar", "rocketchat")
ToolServerName = Literal["hrms", "email", "calendar", "rocketchat"]


class HRAction(Action):
    """An action in the HR environment — invoke a tool on one of the tool servers."""

    tool_server: ToolServerName = Field(
        ...,
        description="Which tool server to target: 'hrms' (employee records, leave, payroll), "
        "'email' (send/read email), 'calendar' (schedule events), or 'rocketchat' (team chat).",
    )
    tool_name: str = Field(
        ...,
        description="Name of the tool to invoke on the selected server. "
        "Use the tools_available field from the observation to see what's available per server.",
    )
    parameters: dict = Field(
        default_factory=dict,
        description="Tool-specific parameters as a JSON object.",
    )


class HRObservation(Observation):
    """Observation returned by the HR environment after each action."""

    result: str = Field(
        ...,
        description="Result of the tool invocation, or initial environment status on reset.",
    )
    is_error: bool = Field(
        default=False,
        description="Whether the tool invocation resulted in an error.",
    )
    tools_available: dict[str, list[str]] = Field(
        default_factory=dict,
        description="Available tools grouped by server: {'hrms': [...], 'email': [...], ...}.",
    )
    task_instruction: str = Field(
        default="",
        description="The task the agent should complete in this episode.",
    )