from functools import cache from typing import Literal import sentry_sdk from pydantic import DirectoryPath, PositiveInt from pydantic_settings import BaseSettings from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration sentry_sdk.init(integrations=[AwsLambdaIntegration()]) class _Settings(BaseSettings): EFS_PATH: DirectoryPath EFS_RETENTION_DAYS: PositiveInt LOG_LEVEL: Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] = "INFO" @cache def get_settings() -> _Settings: return _Settings()