Config Module (config.py)

class config.GoogleConfig(_raw_path='google_credentials.json')[исходный код]

Базовые классы: object

Configuration for Google API access, specifically for service account credentials.

If a relative path is specified in the GOOGLE_CREDENTIALS_PATH environment variable (or if it is not set), it will be converted to an absolute path within the project directory. This avoids issues when the bot is run from any directory or on a different OS (Windows vs Linux).

Параметры:

_raw_path (str)

property credentials_path: str

Absolute path to the service account file.

  • If an absolute path is specified (e.g., /opt/…), it’s returned as is.

  • Otherwise, the path is considered relative to BASE_DIR.

Checks for file existence and provides guidance if not found.

class config.LoggingConfig(level='WARNING', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')[исходный код]

Базовые классы: object

Configuration for application logging.

Параметры:
format: str = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
level: str = 'WARNING'
class config.OpenAIConfig(api_key='', model='gpt-4o-mini', max_retries=2)[исходный код]

Базовые классы: object

Configuration for the OpenAI API client.

Параметры:
  • api_key (str)

  • model (str)

  • max_retries (int)

api_key: str = ''
max_retries: int = 2
model: str = 'gpt-4o-mini'
class config.PrometheusConfig(port=<factory>)[исходный код]

Базовые классы: object

Configuration for prometheus_client exporter.

Параметры:

port (int)

port: int
class config.RateLimiterConfig(llm_requests_per_minute=20, llm_max_burst=5)[исходный код]

Базовые классы: object

Configuration for API rate limiting, specifically for LLM calls.

Параметры:
  • llm_requests_per_minute (int)

  • llm_max_burst (int)

llm_max_burst: int = 5
llm_requests_per_minute: int = 20
class config.SchedulerConfig(timezone='Europe/Moscow', morning_time='08:00', evening_time='20:00', motivation_interval_hours=8)[исходный код]

Базовые классы: object

Configuration for the task scheduler (APScheduler).

Параметры:
  • timezone (str)

  • morning_time (str)

  • evening_time (str)

  • motivation_interval_hours (int)

evening_time: str = '20:00'
morning_time: str = '08:00'
motivation_interval_hours: int = 8
timezone: str = 'Europe/Moscow'
class config.TelegramConfig(token='')[исходный код]

Базовые классы: object

Configuration for the Telegram Bot token.

Параметры:

token (str)

token: str = ''