""" Pydantic models for the OpenENV SQL Debugging environment. """ from typing import Optional from pydantic import BaseModel class SQLAction(BaseModel): """Action submitted by the agent — a SQL query string.""" query: str class SQLObservation(BaseModel): """Observation returned by the environment after reset or step.""" schema_str: str # Table definitions (CREATE TABLE statements) task_description: str # Natural language description of what the query should do broken_query: str # The buggy starting query (provided at reset, unchanged) last_error: Optional[str] = None # Execution error from last action, or None last_output: Optional[str] = None # Stringified output of last query, or None step_number: int = 0 class StepResult(BaseModel): """Result returned after each step.""" observation: SQLObservation reward: float # Per-step reward in [0.0, 1.0] done: bool info: dict