Spaces:
Sleeping
Sleeping
Commit ·
830b0e5
1
Parent(s): 5016a17
fix openenv.yaml with spec_version, type, runtime, app, port
Browse files- openenv.yaml +38 -44
openenv.yaml
CHANGED
|
@@ -1,83 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
spec_version: 1
|
| 2 |
name: sql-correction-env
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
description: >
|
| 5 |
An OpenEnv RL environment where an AI agent fixes broken SQL queries.
|
| 6 |
Simulates a real developer task: identifying and correcting SQL syntax
|
| 7 |
and logical errors across easy, medium, and hard difficulty levels.
|
|
|
|
| 8 |
author: SyncShift
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
observation_space:
|
| 16 |
type: object
|
| 17 |
fields:
|
| 18 |
task_id:
|
| 19 |
type: string
|
| 20 |
-
description: Unique identifier for the current task
|
| 21 |
broken_query:
|
| 22 |
type: string
|
| 23 |
-
description: The malformed SQL query the agent must fix
|
| 24 |
schema_context:
|
| 25 |
type: string
|
| 26 |
nullable: true
|
| 27 |
-
description: Table and column definitions when a task includes schema context
|
| 28 |
error_hint:
|
| 29 |
type: string
|
| 30 |
nullable: true
|
| 31 |
-
description: A hint describing the type of error (provided on easy tasks only)
|
| 32 |
step_number:
|
| 33 |
type: integer
|
| 34 |
-
description: Current step index within the episode
|
| 35 |
previous_attempt:
|
| 36 |
type: string
|
| 37 |
nullable: true
|
| 38 |
-
description: The agent's last submitted corrected query
|
| 39 |
feedback:
|
| 40 |
type: string
|
| 41 |
nullable: true
|
| 42 |
-
description: Grader feedback from the previous step
|
| 43 |
|
| 44 |
action_space:
|
| 45 |
type: object
|
| 46 |
fields:
|
| 47 |
corrected_query:
|
| 48 |
type: string
|
| 49 |
-
description: The agent's corrected SQL query
|
| 50 |
|
| 51 |
reward:
|
| 52 |
range: [0.001, 0.999]
|
| 53 |
description: >
|
| 54 |
-
|
| 55 |
-
0.4 = most keywords correct, 0.2 = basic structure present, 0.
|
| 56 |
-
Stagnation penalty of 0.1 applied after 2 consecutive identical rewards.
|
| 57 |
-
|
| 58 |
-
tasks:
|
| 59 |
-
- name: easy
|
| 60 |
-
difficulty: easy
|
| 61 |
-
max_steps: 5
|
| 62 |
-
description: Fix a single syntax error. Error hint provided.
|
| 63 |
-
grader: sql_env.grader.grade
|
| 64 |
-
|
| 65 |
-
- name: medium
|
| 66 |
-
difficulty: medium
|
| 67 |
-
max_steps: 5
|
| 68 |
-
description: Fix multiple errors across keywords and clauses. No hint.
|
| 69 |
-
grader: sql_env.grader.grade
|
| 70 |
-
|
| 71 |
-
- name: hard
|
| 72 |
-
difficulty: hard
|
| 73 |
-
max_steps: 4
|
| 74 |
-
description: Fix many errors in complex multi-join queries. Schema provided. No hint.
|
| 75 |
-
grader: sql_env.grader.grade
|
| 76 |
-
|
| 77 |
-
endpoints:
|
| 78 |
-
reset: POST /reset
|
| 79 |
-
step: POST /step
|
| 80 |
-
state: POST /state
|
| 81 |
-
tasks: GET /tasks
|
| 82 |
-
grader: POST /grader
|
| 83 |
-
health: GET /health
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: SQL Correction RL Environment
|
| 3 |
+
emoji: 🛢️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- openenv
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
spec_version: 1
|
| 13 |
name: sql-correction-env
|
| 14 |
+
type: sequential
|
| 15 |
+
runtime: docker
|
| 16 |
+
app: server.app:app
|
| 17 |
+
port: 7860
|
| 18 |
+
|
| 19 |
description: >
|
| 20 |
An OpenEnv RL environment where an AI agent fixes broken SQL queries.
|
| 21 |
Simulates a real developer task: identifying and correcting SQL syntax
|
| 22 |
and logical errors across easy, medium, and hard difficulty levels.
|
| 23 |
+
|
| 24 |
author: SyncShift
|
| 25 |
+
|
| 26 |
+
tasks:
|
| 27 |
+
- name: easy
|
| 28 |
+
difficulty: easy
|
| 29 |
+
max_steps: 5
|
| 30 |
+
description: Fix a single syntax error. Error hint provided.
|
| 31 |
+
grader: sql_env.grader.grade
|
| 32 |
+
|
| 33 |
+
- name: medium
|
| 34 |
+
difficulty: medium
|
| 35 |
+
max_steps: 5
|
| 36 |
+
description: Fix multiple errors across keywords and clauses. No hint.
|
| 37 |
+
grader: sql_env.grader.grade
|
| 38 |
+
|
| 39 |
+
- name: hard
|
| 40 |
+
difficulty: hard
|
| 41 |
+
max_steps: 4
|
| 42 |
+
description: Fix many errors in complex multi-join queries. Schema provided.
|
| 43 |
+
grader: sql_env.grader.grade
|
| 44 |
|
| 45 |
observation_space:
|
| 46 |
type: object
|
| 47 |
fields:
|
| 48 |
task_id:
|
| 49 |
type: string
|
|
|
|
| 50 |
broken_query:
|
| 51 |
type: string
|
|
|
|
| 52 |
schema_context:
|
| 53 |
type: string
|
| 54 |
nullable: true
|
|
|
|
| 55 |
error_hint:
|
| 56 |
type: string
|
| 57 |
nullable: true
|
|
|
|
| 58 |
step_number:
|
| 59 |
type: integer
|
|
|
|
| 60 |
previous_attempt:
|
| 61 |
type: string
|
| 62 |
nullable: true
|
|
|
|
| 63 |
feedback:
|
| 64 |
type: string
|
| 65 |
nullable: true
|
|
|
|
| 66 |
|
| 67 |
action_space:
|
| 68 |
type: object
|
| 69 |
fields:
|
| 70 |
corrected_query:
|
| 71 |
type: string
|
|
|
|
| 72 |
|
| 73 |
reward:
|
| 74 |
range: [0.001, 0.999]
|
| 75 |
description: >
|
| 76 |
+
0.999 = exact match, 0.7 = right tokens minor structure diff,
|
| 77 |
+
0.4 = most keywords correct, 0.2 = basic structure present, 0.001 = invalid SQL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|