File size: 881 Bytes
4e73462
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Dict, List, Optional


# NOTE:
# These are *prompt contracts* (input/output shapes) for LLM-facing stages.
# They are intentionally lightweight to keep Block C minimal and low-risk.


@dataclass(frozen=True)
class PlannerPromptInput:
    user_query: str
    schema_preview: str  # already budgeted at pipeline boundary
    constraints: List[str]


@dataclass(frozen=True)
class PlannerPromptOutput:
    plan: str
    used_tables: List[str]


@dataclass(frozen=True)
class GeneratorPromptInput:
    user_query: str
    schema_preview: str  # already budgeted at pipeline boundary
    plan: str
    constraints: List[str]
    clarify_answers: Optional[Dict[str, Any]] = None


@dataclass(frozen=True)
class GeneratorPromptOutput:
    sql: str
    rationale: str
    used_tables: List[str]