File size: 412 Bytes
56ff037
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import json 
def load_examples(path: str = 'examples.json'):
    with open(path, "r", encoding="utf-8") as f:
        return json.load(f)
    
    examples = []
    for category, items in data.items():
        for item in items:
            examples.append({
                "category": category,
                "question": item["pregunta"],
                "sql": item["sql"]
            })
    return examples