"""Agent config, all from env (the control container is configured at run).""" import os from dataclasses import dataclass @dataclass class Config: fc_url: str # base URL of the FabledCurator web service token: str # the bearer token from Settings → Tagging → GPU agent agent_id: str # identifies this agent's leases batch_size: int # jobs leased per round (concurrency is still 1) ccip_model: str # imgutils CCIP model name ("" → imgutils default) detector_level: str # imgutils person-detector level: n|s|m|x poll_idle_seconds: float # wait between empty leases @classmethod def from_env(cls) -> "Config": return cls( fc_url=os.environ.get("FC_URL", "http://localhost:8000").rstrip("/"), token=os.environ.get("FC_TOKEN", ""), agent_id=os.environ.get("AGENT_ID", "desktop-agent"), batch_size=int(os.environ.get("BATCH_SIZE", "4")), ccip_model=os.environ.get("CCIP_MODEL", ""), detector_level=os.environ.get("DETECTOR_LEVEL", "m"), poll_idle_seconds=float(os.environ.get("POLL_IDLE_SECONDS", "10")), )