INNER CODE UNIT · Python
path
Dsadd4/AgentFigureGallery · agentfiguregallery/server.py:61
path = root / path
path = path.resolve()
if not is_under(path, root):
raise ValueError(f"Path is outside AgentFigureGallery root: {path}")
return path
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]}"