20 lines
449 B
Python
20 lines
449 B
Python
"""初始化 NL2SQL 的 Milvus 数据库和集合。"""
|
|||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import asyncio
|
||
|
|
import sys
|
||
|
|
from pathlib import Path
|
||
|
|
|
||
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
||
|
|
|
||
|
|
from config.database.milvus import client
|
||
|
|
from nl2sql.milvus_collections import ensure_nl2sql_collection
|
||
|
|
|
||
|
|
|
||
|
|
async def initialize() -> None:
|
||
|
|
await ensure_nl2sql_collection(client())
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
asyncio.run(initialize())
|