- Add database migrations (006-028) for face recognition, identity, file_uuid - Add test scripts for ASR, face, search, processing - Add portal frontend (Tauri) - Add config, benchmark, and monitoring utilities - Add model checkpoints and pretrained model references
27 lines
648 B
Python
27 lines
648 B
Python
#!/usr/bin/env python3
|
|
import re
|
|
import sys
|
|
|
|
with open("src/api/server.rs", "r") as f:
|
|
content = f.read()
|
|
|
|
# Read new handlers
|
|
with open("new_handlers.txt", "r") as f:
|
|
new_handlers = f.read()
|
|
|
|
# Pattern: closing brace of n8n_search, blank line, start of hybrid_search
|
|
# Use exact newlines
|
|
pattern = r"\}\n\nasync fn hybrid_search\("
|
|
replacement = "}\n\n" + new_handlers + "\n\nasync fn hybrid_search("
|
|
|
|
new_content = re.sub(pattern, replacement, content, count=1)
|
|
|
|
if new_content == content:
|
|
print("Pattern not found")
|
|
sys.exit(1)
|
|
|
|
with open("src/api/server.rs", "w") as f:
|
|
f.write(new_content)
|
|
|
|
print("Inserted BM25 handlers")
|