File size: 767 Bytes
1a16689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import requests

space_url = "https://ritvik360-nl2sql-bench.hf.space"

print("1. Resetting environment...")
try:
    res_reset = requests.post(f"{space_url}/reset", json={"task_name": "simple-filter"})
    print(f"Reset Status: {res_reset.status_code}")
except Exception as e:
    print(f"Network error on reset: {e}")

print("\n2. Sending test SQL step...")
try:
    # We send a perfectly valid query that should score > 0
    payload = {"query": "SELECT id, name, email, country FROM customers WHERE tier = 'gold'"}
    res_step = requests.post(f"{space_url}/step", json=payload)
    
    print(f"Step Status: {res_step.status_code}")
    print(f"Step Response:\n{res_step.text}")
except Exception as e:
    print(f"Network error on step: {e}")