This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_settings.py
62 lines (54 loc) · 1.66 KB
/
api_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""Settings for the API."""
from pydantic import AnyHttpUrl, BaseSettings, Field
class Settings(BaseSettings):
"""Settings for the API."""
# CORS config
CORS_ORIGINS: list[str | AnyHttpUrl] = Field(
default=["*"],
env="CORS_ORIGINS",
description="A list of origins to allow CORS requests from.",
)
# Azure CV config
AZ_CV_KEY: str = Field(
default=...,
env="AZ_CV_KEY",
description="The Azure Computer Vision instance key.",
)
AZ_CV_ENDPOINT: str = Field(
default=...,
env="AZ_CV_ENDPOINT",
description="The Azure Computer Vision instance endpoint.",
)
# Hugging Face config
HF_TOKEN: str = Field(
default=...,
env="HF_TOKEN",
description="The Hugging Face token for authenticating with the inference API.",
)
# Azure AD config
AZ_AD_TENANT_DOMAIN: str = Field(
default=...,
env="AZ_AD_TENANT_DOMAIN",
description="The Azure AD directory domain.",
)
AZ_TENANT_ID: str = Field(
default=...,
env="AZ_TENANT_ID",
description="The Azure AD tenant ID.",
)
AZ_AD_APP_CLIENT_ID: str = Field(
default=...,
env="AZ_AD_APP_CLIENT_ID",
description="The Azure AD app client ID.",
)
AZ_AD_DOCS_CLIENT_ID: str = Field(
default=...,
env="AZ_AD_DOCS_CLIENT_ID",
description="The Azure AD docs (Swagger) client ID.",
)
class Config: # pylint: disable=too-few-public-methods
"""Config for the environment."""
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = True
SETTINGS = Settings()