"""Model version aliases. The web studio exposes friendly names (``P2.0``, ``H3.1`` ...) that map onto the internal ``model_version`` strings the API expects. Verified against the live API: ``Nexus-v2.0-20260801`` and ``v3.1-20260211`` both generate successfully. """ SMART_MESH_DEFAULT = "Nexus-v2.0-20260801" HIGH_DETAIL_DEFAULT = "v3.1-20260211" # Aliases are matched case-insensitively. ALIASES = { # 智能网格 Smart Mesh "p2.0": SMART_MESH_DEFAULT, "p2": SMART_MESH_DEFAULT, "nexus-v2": SMART_MESH_DEFAULT, "p1.0": "Nexus-v1.0-20260214", "p1": "Nexus-v1.0-20260214", "nexus-v1": "Nexus-v1.0-20260214", # 高精度模型 High-Detail "h3.1": HIGH_DETAIL_DEFAULT, "v3.1": HIGH_DETAIL_DEFAULT, "h3.0": "v3.0-20250812", "v3.0": "v3.0-20250812", "h2.5": "v2.5-20250123", "v2.5": "v2.5-20250123", } def resolve(name, smart_mesh=False): """Map a user supplied alias to an internal model version string. Unknown values pass through untouched so a brand new server-side version can still be used without a client release. """ if not name: return SMART_MESH_DEFAULT if smart_mesh else HIGH_DETAIL_DEFAULT return ALIASES.get(name.strip().lower(), name.strip()) def default_for(smart_mesh=False): return SMART_MESH_DEFAULT if smart_mesh else HIGH_DETAIL_DEFAULT