| Server IP : 157.230.181.24 / Your IP : 216.73.217.11 Web Server : Apache/2.4.58 (Ubuntu) System : Linux conductive 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64 User : ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /opt/aim-bots/ |
Upload File : |
#!/usr/bin/env python3
"""Seed AIM profile HTML into Open OSCAR Server for all persona bots."""
from __future__ import annotations
import json
import sys
from pathlib import Path
from aim_profiles import PROFILES, load_profile_from_voice, persist_aim_profile
PERSONAS_DIR = Path("/opt/aim-bots/personas")
def main() -> int:
db = Path(sys.argv[1]) if len(sys.argv) > 1 else Path("/var/lib/ras/oscar.sqlite")
for persona_dir in sorted(PERSONAS_DIR.iterdir()):
if not persona_dir.is_dir():
continue
persona_path = persona_dir / "persona.json"
voice_path = persona_dir / "voice.json"
if not persona_path.exists():
continue
persona = json.loads(persona_path.read_text())
voice = json.loads(voice_path.read_text()) if voice_path.exists() else {}
sn = persona["screen_name"]
html = load_profile_from_voice(voice, persona) or PROFILES.get(sn.lower(), "")
if not html:
print(f"skip {sn}: no profile_html")
continue
persist_aim_profile(sn, html, db_path=db)
print(f"profile set: {sn} ({len(html)} chars)")
return 0
if __name__ == "__main__":
raise SystemExit(main())