Spaces:
Sleeping
Sleeping
File size: 973 Bytes
2f8e591 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | """
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
|