Files
Mutual_Fund/scripts/check_nl2sql_health.py
T

32 lines
794 B
Python

"""命令行检查 NL2SQL 依赖健康状态。"""
from __future__ import annotations
import asyncio
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from config import database
from nl2sql.health import check_nl2sql_health
from tool.llm import llm
async def check() -> dict:
"""检查 MySQL、Redis、Milvus 和 LLM 首选端点。"""
try:
return await check_nl2sql_health(
{
"mysql": database.mysql.check_health,
"redis": database.redis.check_health,
"milvus": database.milvus.check_health,
"llm": llm.check_health,
}
)
finally:
await database.dispose()
if __name__ == "__main__":
print(asyncio.run(check()))