| 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" | |
| ) | |