Source code for lalandre_core.utils.mode_aliases

"""
RAG query mode aliases.

Single source of truth for legacy mode names → canonical mode mapping.
Used by both api-gateway and rag-service to resolve mode aliases consistently.
"""

from typing import Dict

MODE_ALIASES: Dict[str, str] = {
    "hybrid": "rag",
    "semantic": "rag",
    "lexical": "rag",
    "graph": "rag",
    "search": "rag",
    "qa": "rag",  # legacy frontend value
}

VALID_QUERY_MODES = {"rag", "llm_only", "summarize", "compare"}


[docs] def resolve_mode_alias(mode: str) -> str: """Return the canonical mode name, resolving legacy aliases.""" return MODE_ALIASES.get(mode.lower(), mode.lower())