34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import os
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class CubeReportSettings:
|
|
dify_api_base: str
|
|
dify_api_key: str
|
|
cube_api_base: str
|
|
cube_api_token: str
|
|
request_timeout_seconds: float
|
|
default_page_size: int
|
|
max_page_size: int
|
|
|
|
|
|
def get_cube_report_settings() -> CubeReportSettings:
|
|
return CubeReportSettings(
|
|
dify_api_base=os.getenv(
|
|
"DIFY_DATABASE_ASSISTANT_API_BASE", "https://chat.bbitcn.net/v1"
|
|
).rstrip("/"),
|
|
dify_api_key=os.getenv(
|
|
"DIFY_DATABASE_ASSISTANT_API_KEY", "app-uibWo8ZEpqHCsWXREPTCBDH6"
|
|
),
|
|
cube_api_base=os.getenv(
|
|
"CUBE_API_BASE_URL", "http://10.10.12.101:4001/cubejs-api/v1"
|
|
).rstrip("/"),
|
|
cube_api_token=os.getenv("CUBE_API_TOKEN", ""),
|
|
request_timeout_seconds=float(
|
|
os.getenv("CUBE_REPORT_REQUEST_TIMEOUT_SECONDS", "180")
|
|
),
|
|
default_page_size=int(os.getenv("CUBE_REPORT_DEFAULT_PAGE_SIZE", "20")),
|
|
max_page_size=int(os.getenv("CUBE_REPORT_MAX_PAGE_SIZE", "100")),
|
|
)
|