from enum import Enum class Platform(str, Enum): AZURE = "azure" OPENAI = "openai" ANTHROPIC = "anthropic" GCP = "gcp" @classmethod def from_string(cls, platform: str) -> "Platform": platform = platform.lower().strip() try: return cls(platform) except Exception: raise ValueError(f"platform must be {cls.__members__}, but got {platform}.")