File size: 758 Bytes
e042d72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Action and observation models. One generic action serves every task: each task lists its own tools."""

from typing import Any

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


class ToolAction(Action):
    tool: str = Field(min_length=1, max_length=40, description="Name of one of the tools listed in the task.")
    args: dict[str, Any] = Field(
        default_factory=dict,
        description="Arguments for that tool, exactly as the task lists them (an empty object if it takes none).",
    )


class ToolObservation(Observation):
    output: str = Field(default="", description="Result of the last tool call.")
    steps_left: int = Field(default=0, description="Tool calls left before the episode ends.")