feat: add auth/compliance/kyc/market/template modules, alembic migrations, tests and docs
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
"""Rebuild Milvus vectors for approved script templates."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from app.repository.template_repository import TemplateRepository
|
||||
from app.service.template_vector_service import TemplateVectorService
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Sync approved script templates to Milvus.")
|
||||
parser.add_argument("--dry-run", action="store_true", help="Only count approved active templates.")
|
||||
parser.add_argument("--created-by", default=None, help="Optional created_by filter for development checks.")
|
||||
args = parser.parse_args()
|
||||
|
||||
repository = TemplateRepository()
|
||||
if args.dry_run:
|
||||
total = len(repository.list_vector_candidates(created_by=args.created_by))
|
||||
print(f"Template vector sync dry run: total={total}")
|
||||
return
|
||||
|
||||
result = TemplateVectorService(repository=repository).sync_approved_templates(created_by=args.created_by)
|
||||
print(
|
||||
"Template vector sync: "
|
||||
f"total={result.total}, upserted={result.upserted}, skipped={result.skipped}"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user