File size: 415 Bytes
88435ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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}.")