Kpenciler's picture
Upload 53 files
88435ed verified
raw
history blame
415 Bytes
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}.")