File size: 969 Bytes
fa2277d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from openenv.core.env_server.types import Action, Observation, State
from pydantic import Field


class MyAction(Action):
    """What the agent sends to the environment each step."""

    tool_name: str = Field(..., description="Tool to call")
    tool_args: dict = Field(default_factory=dict, description="Arguments for the tool")


class MyObservation(Observation):
    """What the environment returns after each step."""

    result: str = Field(default="", description="Text description of what happened")
    available_tools: list[str] = Field(
        default_factory=list, description="List of available tools"
    )
    task_completed: bool = Field(default=False, description="Whether the task is complete")


class MyState(State):
    """Internal episode state."""

    task_description: str = Field(default="", description="Current task description")
    history: list[dict] = Field(
        default_factory=list, description="History of actions taken"
    )