feat:用户画像功能
This commit is contained in:
+4
-2
@@ -107,10 +107,12 @@ def resolve_semantics(question: str, *, catalog: dict[str, Any] | None = None) -
|
||||
{
|
||||
"term": item["term"],
|
||||
"field": item["fields"][0],
|
||||
"hint": item.get("metric_hint", item.get("value_hint", "")),
|
||||
"hint": item.get("metric_hint") or item.get("value_hint", ""),
|
||||
}
|
||||
# metric_hint(指标口径)与 value_hint(字段取值口径)都要进入
|
||||
# SQL 生成上下文;只过滤 metric_hint 会让枚举值提示永远丢失。
|
||||
for item in matched
|
||||
if "metric_hint" in item
|
||||
if "metric_hint" in item or "value_hint" in item
|
||||
]
|
||||
return {
|
||||
"terms": [item["term"] for item in matched],
|
||||
|
||||
Reference in New Issue
Block a user