sql-debug-env / server /models.py
darshsingh1's picture
Upload folder using huggingface_hub
2f8e591 verified
Raw History Blame Contribute Delete
973 Bytes
"""
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