Spaces:
Sleeping
Sleeping
File size: 3,927 Bytes
d075fca | 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | spec_version: 1
name: sql_query_env
description: >
Trains agents to generate SQL queries from natural language questions.
Tests across three database domains (company analytics, hospital
management, e-commerce) with efficiency scoring and diagnostic feedback.
type: space
runtime: fastapi
app: server.app:app
port: 8000
tasks:
# Company
- id: company_easy_1
name: "Company β Engineering Employees"
difficulty: easy
description: "List active Engineering employees sorted by salary"
domain: company
- id: company_easy_2
name: "Company β Electronics Products"
difficulty: easy
description: "Filter electronics products by price"
domain: company
- id: company_medium_1
name: "Company β Revenue by Category"
difficulty: medium
description: "Total revenue per product category for completed orders"
domain: company
- id: company_medium_2
name: "Company β Department Salaries"
difficulty: medium
description: "Departments with average salary exceeding $100K"
domain: company
- id: company_hard_1
name: "Company β Budget Utilization"
difficulty: hard
description: "Department salary-to-budget utilization percentage"
domain: company
# Hospital
- id: hospital_easy_1
name: "Hospital β Current Patients"
difficulty: easy
description: "List patients still admitted (NULL discharge date)"
domain: hospital
- id: hospital_medium_1
name: "Hospital β Medication Costs"
difficulty: medium
description: "Total medication cost for admitted patients"
domain: hospital
- id: hospital_hard_1
name: "Hospital β Cross-Ward Prescriptions"
difficulty: hard
description: "Doctors prescribing to patients outside their ward"
domain: hospital
# E-Commerce
- id: ecommerce_easy_1
name: "E-Commerce β Premium Users"
difficulty: easy
description: "List premium users with signup details"
domain: ecommerce
- id: ecommerce_medium_1
name: "E-Commerce β Seller Revenue"
difficulty: medium
description: "Revenue per seller for delivered orders"
domain: ecommerce
- id: ecommerce_hard_1
name: "E-Commerce β Return Rate Analysis"
difficulty: hard
description: "Return rate per product category with edge cases"
domain: ecommerce
# Expert-level
- id: company_hard_2
name: "Company β Salary vs Manager"
difficulty: hard
description: "Employees earning more than their direct manager (self-join)"
domain: company
- id: hospital_hard_2
name: "Hospital β Repeat Visits"
difficulty: hard
description: "Patients with multiple appointments with the same doctor"
domain: hospital
- id: ecommerce_hard_2
name: "E-Commerce β Dead Stock"
difficulty: hard
description: "In-stock products that have never been ordered (anti-join)"
domain: ecommerce
action_space:
type: object
properties:
query:
type: string
description: "SQL SELECT query to execute against the database"
observation_space:
type: object
properties:
task_id:
type: string
difficulty:
type: string
enum: [easy, medium, hard]
database_domain:
type: string
description: "Company Analytics, Hospital Management, or E-Commerce Platform"
question:
type: string
schema_description:
type: string
query_result:
type: string
query_error:
type: string
feedback:
type: string
diagnostics:
type: array
description: "Structured diagnostic feedback (type, severity, message, suggestion)"
efficiency_notes:
type: array
description: "SQL efficiency and best-practice feedback"
expected_row_count:
type: integer
expected_columns:
type: array
steps_remaining:
type: integer
current_score:
type: number
history:
type: array
|