@@ -88,27 +88,27 @@ def wrapper(text: str) -> str:
88
88
89
89
90
90
## End of Pipeline
91
- class ModelProperties (BaseModel ):
91
+ class Properties (BaseModel ):
92
92
alias : str
93
93
description : str
94
94
95
95
96
96
class ModelColumns (BaseModel ):
97
97
name : str
98
- properties : ModelProperties
98
+ properties : Properties
99
99
100
100
101
101
class SemanticModel (BaseModel ):
102
102
name : str
103
103
columns : list [ModelColumns ]
104
- properties : ModelProperties
104
+ properties : Properties
105
105
106
106
107
107
class SemanticResult (BaseModel ):
108
108
models : list [SemanticModel ]
109
109
110
110
111
- semantics_enrichment_KWARGS = {
111
+ SEMANTICS_ENRICHMENT_KWARGS = {
112
112
"response_format" : {
113
113
"type" : "json_schema" ,
114
114
"json_schema" : {
@@ -137,34 +137,9 @@ class SemanticResult(BaseModel):
137
137
- Aliases should be intuitive and user-friendly
138
138
- Use the user's context to inform the descriptions
139
139
- Maintain technical accuracy while being accessible to non-technical users
140
-
141
- Output Format:
142
- {
143
- "models": [{
144
- "name": "model",
145
- "columns": [{
146
- "name": "column",
147
- "properties": {
148
- "alias": "User-friendly column name",
149
- "description": "Clear explanation of column purpose"
150
- }
151
- }],
152
- "properties": {
153
- "alias": "User-friendly model name",
154
- "description": "Clear explanation of model purpose"
155
- }
156
- }]
157
- }
158
-
159
- Example:
160
- Input model "orders" with column "created_at" might become:
161
- {
162
- "name": "created_at",
163
- "properties": {
164
- "alias": "Order Creation Date",
165
- "description": "Timestamp when the order was first created in the system"
166
- }
167
- }
140
+ - IMPORTANT: Never modify the model/table and column names in the 'name' field as this will invalidate the data model
141
+ - Only update the 'alias' field to provide user-friendly display names
142
+ - When the user prompt includes operators to modify names, apply those modifications to the alias field only
168
143
169
144
Focus on providing business value through clear, accurate descriptions while maintaining JSON structure integrity.
170
145
"""
@@ -185,7 +160,7 @@ def __init__(self, llm_provider: LLMProvider, **_):
185
160
"prompt_builder" : PromptBuilder (template = user_prompt_template ),
186
161
"generator" : llm_provider .get_generator (
187
162
system_prompt = system_prompt ,
188
- generation_kwargs = semantics_enrichment_KWARGS ,
163
+ generation_kwargs = SEMANTICS_ENRICHMENT_KWARGS ,
189
164
),
190
165
}
191
166
self ._final = "normalize"
0 commit comments