feat:用户画像功能

This commit is contained in:
2026-09-14 00:19:31 +08:00
parent cf8fcf63c9
commit a7f9e182a4
17 changed files with 971 additions and 37 deletions
+4 -2
View File
@@ -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],