File size: 768 Bytes
2ce79be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from typing import Literal

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


class SQLAction(Action):
    op: Literal["query", "submit", "finish"] = Field(
        description="query explores the database; submit executes your final answer SQL and ends with a correctness reward; finish ends with reward zero."
    )
    sql: str = Field(
        default="",
        max_length=8000,
        description="One read-only SQLite SELECT/WITH statement. Required for query and submit; ignored by finish.",
    )


class SQLObservation(Observation):
    message: str = ""
    columns: list[str] = Field(default_factory=list)
    rows: list[list[str | int | float | None]] = Field(default_factory=list)
    remaining_steps: int = 12