14 lines
409 B
Python
14 lines
409 B
Python
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||
|
|
from functools import lru_cache
|
||
|
|
|
||
|
|
class Settings(BaseSettings):
|
||
|
|
mastodon_server:str
|
||
|
|
openai_api_key:str
|
||
|
|
feeds: dict[str, dict[str,object]]
|
||
|
|
model_config = SettingsConfigDict(env_file=".env", env_nested_delimiter='__', arbitrary_types_allowed=True)
|
||
|
|
version:str
|
||
|
|
|
||
|
|
@lru_cache
|
||
|
|
def get_settings():
|
||
|
|
return Settings() # type: ignore
|