INNER CODE UNIT · Python

global_preference_key

Dsadd4/AgentFigureGallery · agentfiguregallery/server.py:68

def global_preference_key(candidate: dict) -> str:
    if candidate.get("global_preference_key"):
        return str(candidate["global_preference_key"])
    for prefix, key in [
        ("output", "source_output_path_rel"),
        ("reference", "reference_candidate_id"),
        ("preview", "preview_path_rel"),
        ("script", "script_path_rel"),
    ]:
        if candidate.get(key):
            return f"{prefix}:{candidate[key]}"
    return f"candidate:{candidate.get('candidate_id') or candidate.get('stable_candidate_id') or 'unknown'}"


def global_preferences_path(root: Path) -> Path:
    return root / "data" / "reference_global_preferences.json"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…