feat:新增投顾agent和nl2sqlagent

This commit is contained in:
2026-09-13 16:19:24 +08:00
parent c80c6acac0
commit 163192bf55
122 changed files with 7488 additions and 362 deletions
+23
View File
@@ -0,0 +1,23 @@
"""NL2SQL Milvus 运维操作。"""
from __future__ import annotations
from nl2sql.milvus_collections import NL2SQL_COLLECTION
INVALID_VECTOR_FILTER = "is_valid == false or is_deprecated == true"
async def cleanup_invalid_vectors(milvus_client) -> int:
"""删除无效或已废弃的元数据向量,并返回删除前的数量。"""
rows = await milvus_client.query(
collection_name=NL2SQL_COLLECTION,
filter=INVALID_VECTOR_FILTER,
output_fields=["id"],
)
count = len(rows or [])
if count:
await milvus_client.delete(
collection_name=NL2SQL_COLLECTION,
filter=INVALID_VECTOR_FILTER,
)
return count