You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
963 B
Python

import os
from dataclasses import dataclass
from dotenv import load_dotenv
load_dotenv()
GOOGLE_SCOPES = (
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/calendar.readonly",
)
@dataclass(frozen=True)
class Settings:
google_client_secrets_file: str
google_token_file: str
gmail_scan_interval_minutes: int
gmail_query: str
agent_api_key: str
log_level: str
def get_settings() -> Settings:
return Settings(
google_client_secrets_file=os.getenv("GOOGLE_CLIENT_SECRETS_FILE", "credentials.json"),
google_token_file=os.getenv("GOOGLE_TOKEN_FILE", "token.json"),
gmail_scan_interval_minutes=int(os.getenv("GMAIL_SCAN_INTERVAL_MINUTES", "5")),
gmail_query=os.getenv(
"GMAIL_QUERY", "in:inbox -label:AgentProcessed newer_than:7d"
),
agent_api_key=os.getenv("AGENT_API_KEY", ""),
log_level=os.getenv("LOG_LEVEL", "INFO"),
)