quackamollie.core.cli.settings module¶
This module contains tools to set configuration in CLI and access it as read only during async execution
- class quackamollie.core.cli.settings.QuackamollieSettings(*, enable_settings_edition: bool = True, raise_error_when_not_editable: bool = True)[source]¶
Bases:
BaseModelThis is an information object that is used to set inferred config in CLI and then read it in aiogram async functions. To avoid the use of ContextLock at runtime and because configuration should not dynamically change, setting values is disabled after synchron initialization by the CLI. Note that:
this object must have an empty constructor in order to be embedded as a click pass decorator, so all fields should have defaults
if you want to store dynamic data at runtime you are invited to do so by storing them into the SQL database or other custom solutions you may implement
- _abc_impl = <_abc._abc_data object>¶
- _additional_config: Dict[str, Any] | None = ModelPrivateAttr()¶
- _admin_ids: List[int] = ModelPrivateAttr(default=[])¶
- _anonymized_db_url: str | None = ModelPrivateAttr()¶
- _authorized_ids: Set[int] = ModelPrivateAttr(default=set())¶
- _bot: Bot | None = ModelPrivateAttr()¶
- _bot_token: str | None = ModelPrivateAttr()¶
- _commands: List[BotCommand] = ModelPrivateAttr(default=[])¶
- _config: Dict[str, Any] | None = ModelPrivateAttr()¶
- _config_file: str | None = ModelPrivateAttr()¶
- _data_dir: str | None = ModelPrivateAttr(default='data/quackamollie')¶
- _db_host: str = ModelPrivateAttr(default='0.0.0.0')¶
- _db_name: str = ModelPrivateAttr(default='quackamollie')¶
- _db_password: str | None = ModelPrivateAttr()¶
- _db_port: int | None = ModelPrivateAttr()¶
- _db_protocol: str = ModelPrivateAttr(default='postgresql+asyncpg')¶
- _db_url: str | None = ModelPrivateAttr()¶
- _db_username: str | None = ModelPrivateAttr()¶
- _default_model: str | None = ModelPrivateAttr()¶
- _default_model_config: str | None = ModelPrivateAttr()¶
- _default_model_manager: str | None = ModelPrivateAttr()¶
- _dispatcher: Dispatcher | None = ModelPrivateAttr()¶
- _engine: AsyncEngine | None = ModelPrivateAttr()¶
- _history_max_length: int | None = ModelPrivateAttr(default=20)¶
- _log_dir: str | None = ModelPrivateAttr()¶
- _logging_config: Dict[str, Any] | None = ModelPrivateAttr()¶
- _min_nb_chunk_to_show: int = ModelPrivateAttr(default=10)¶
- _moderator_ids: List[int] = ModelPrivateAttr(default=[])¶
- _ollama_base_url: str | None = ModelPrivateAttr(default='http://localhost:11434')¶
- _session: async_sessionmaker[AsyncSession] | None = ModelPrivateAttr()¶
- _user_ids: List[int] = ModelPrivateAttr(default=[])¶
- _verbose: int = ModelPrivateAttr(default=0)¶
- property additional_config: Dict[str, Any] | None¶
Used to store additional configuration, i.e. tokens/URL/data given through CLI and constant through runtime
- Returns:
The additional configuration fields given through CLI unknown options
- Return type:
Optional[Dict[str, Any]]
- property admin_ids: List[int]¶
A list of admin Telegram IDs
- Returns:
A list, empty by default, of admin IDs as integers
- Return type:
List[int]
- property anonymized_admin_ids: List[str]¶
The list of admin IDs with sensitive information replaced by ‘*’. We show the last 3 digits of the IDs, so we can check if the list matches what is expected
- Returns:
The list of admin IDs with sensitive information replaced by ‘*’
- Return type:
List[str]
- property anonymized_authorized_ids: Set[str]¶
The list of all authorized IDs with sensitive information replaced by ‘*’. We show the last 3 digits of the IDs, so we can check if the list matches what is expected
- Returns:
The list of all authorized IDs with sensitive information replaced by ‘*’
- Return type:
Set[str]
- property anonymized_bot_token: str | None¶
Telegram bot API token with sensitive information replaced by ‘*’. We show the last 3 digits of the user part of the token so the admin can check if the token used matches what is expected
- Returns:
The API token for the Telegram bot with sensitive information replaced by ‘*’
- Return type:
Optional[str]
- property anonymized_db_password: str | None¶
The password for postgres database connection with sensitive information replaced by ‘*’.
- Returns:
The password for postgres database connection with sensitive information replaced by ‘*’
- Return type:
Optional[str]
- property anonymized_db_url: str | None¶
URL of the postgres database
- Returns:
The URL of the postgres database
- Return type:
Optional[str]
- property anonymized_db_username: str | None¶
The username for postgres database connection with sensitive information replaced by ‘*’. We show the last 3 digits of the username, so we can check if the list matches what is expected
- Returns:
The username for postgres database connection with sensitive information replaced by ‘*’
- Return type:
Optional[str]
- property anonymized_moderator_ids: List[str]¶
The list of moderator IDs with sensitive information replaced by ‘*’. We show the last 3 digits of the IDs, so we can check if the list matches what is expected
- Returns:
The list of moderator IDs with sensitive information replaced by ‘*’
- Return type:
List[str]
- property anonymized_user_ids: List[str]¶
The list of user IDs with sensitive information replaced by ‘*’. We show the last 3 digits of the IDs, so we can check if the list matches what is expected
- Returns:
The list of user IDs with sensitive information replaced by ‘*’
- Return type:
List[str]
- property authorized_ids: Set[int]¶
The list of all authorized Telegram IDs inferred from admin, moderator and user Telegram IDs
- Returns:
A list, empty by default, of all authorized IDs as integers
- Return type:
Set[int]
- property bot: Bot | None¶
Telegram bot, typically initialized from given Telegram API token
- Returns:
The Telegram bot
- Return type:
Optional[Bot]
- property bot_token: str | None¶
Telegram bot API token
- Returns:
The API token for the Telegram bot
- Return type:
Optional[str]
- property commands: List[BotCommand]¶
Telegram bot commands list
- Returns:
The list of commands for the Telegram bot
- Return type:
List[BotCommand]
- property config: Dict[str, Any] | None¶
The configuration imported from the configuration file in the form of a dictionary
- Returns:
The configuration parsed from configuration file path
- Return type:
Optional[Dict[str, Any]]
- property config_file: str | None¶
Path of the application’s configuration file
- Returns:
The application’s configuration file path
- Return type:
Optional[str]
- property data_dir: str | None¶
Directory path dedicated to Quackamollie’s data
- Returns:
Directory path dedicated to Quackamollie’s data
- Return type:
Optional[str]
- property db_host: str¶
Hostname of the postgres database
- Returns:
The hostname of the postgres database
- Return type:
str
- property db_name: str¶
Name of the postgres database
- Returns:
The name of the postgres database
- Return type:
str
- property db_password: str | None¶
Password for postgres database connection
- Returns:
The password for postgres database connection
- Return type:
Optional[str]
- property db_port: int | None¶
Port of the postgres database
- Returns:
The port of the postgres database
- Return type:
Optional[int]
- property db_protocol: str¶
Database protocol, must be a protocol supported by SQLAlchemy
- Returns:
The database protocol
- Return type:
str
- property db_url: str | None¶
URL of the postgres database
- Returns:
The URL of the postgres database
- Return type:
Optional[str]
- property db_username: str | None¶
Username for postgres database connection
- Returns:
The username for postgres database connection
- Return type:
Optional[str]
- property default_model: str | None¶
The name of the model to use by default
- Returns:
The name of the model to use by default
- Return type:
Optional[str]
- property default_model_config: str | None¶
The additional configuration for instantiation of the default model
- Returns:
Additional configuration of the model to use by default
- Return type:
Optional[str]
- property default_model_manager: str | None¶
The name of the ModelManager to use by default
- Returns:
The name of the ModelManager to use by default
- Return type:
Optional[str]
- property dispatcher: Dispatcher | None¶
Telegram dispatcher
- Returns:
The Telegram dispatcher
- Return type:
Optional[Dispatcher]
- enable_settings_edition: bool¶
- property engine: AsyncEngine | None¶
SQLAlchemy Engine for database requests, initialized by CLI with database config
- Returns:
The SQLAlchemy Engine
- Return type:
Optional[AsyncEngine]
- property history_max_length: int | None¶
Maximum length of the history, in number of messages including those previously generated, to include when answering a message using a model. If None, no limit is applied during the request to the database.
- Returns:
The maximum length of the history to include when answering a message using a model
- Return type:
Optional[int]
- property log_dir: str | None¶
Directory path for logs
- Returns:
Directory path for logs
- Return type:
Optional[str]
- property logging_config: Dict[str, Any] | None¶
The ‘logging’ configuration imported from the configuration file in the form of a dictionary
- Returns:
The ‘logging’ configuration parsed from configuration file path
- Return type:
Optional[Dict[str, Any]]
- property min_nb_chunk_to_show: int¶
Minimum number of chunks to show at the same time when streaming the answer of a model. A value of 10 implies trying the edition of the generated Telegram message every 10 chunks.
- Returns:
The minimum number of chunks to show at the same time when streaming the answer of a model
- Return type:
int
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {'additional_config': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[typing.Dict[str, typing.Any]], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Used to store additional configuration, i.e. tokens/URL/data given through CLI and constant through runtime\n\n:return: The additional configuration fields given through CLI unknown options\n:rtype: Optional[Dict[str, Any]]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'admin_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[int], alias=None, alias_priority=None, title=None, field_title_generator=None, description='A list of admin Telegram IDs\n\n:return: A list, empty by default, of admin IDs as integers\n:rtype: List[int]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_admin_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The list of admin IDs with sensitive information replaced by '*'. We show the last 3 digits of the IDs,\nso we can check if the list matches what is expected\n\n:return: The list of admin IDs with sensitive information replaced by '*'\n:rtype: List[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_authorized_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Set[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The list of all authorized IDs with sensitive information replaced by '*'. We show the last 3 digits\nof the IDs, so we can check if the list matches what is expected\n\n:return: The list of all authorized IDs with sensitive information replaced by '*'\n:rtype: Set[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_bot_token': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="Telegram bot API token with sensitive information replaced by '*'. We show the last 3 digits of the user\npart of the token so the admin can check if the token used matches what is expected\n\n:return: The API token for the Telegram bot with sensitive information replaced by '*'\n:rtype: Optional[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_db_password': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The password for postgres database connection with sensitive information replaced by '*'.\n\n:return: The password for postgres database connection with sensitive information replaced by '*'\n:rtype: Optional[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_db_url': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='URL of the postgres database\n\n:return: The URL of the postgres database\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_db_username': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The username for postgres database connection with sensitive information replaced by '*'. We show the\nlast 3 digits of the username, so we can check if the list matches what is expected\n\n:return: The username for postgres database connection with sensitive information replaced by '*'\n:rtype: Optional[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_moderator_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The list of moderator IDs with sensitive information replaced by '*'. We show the last 3 digits of the IDs,\nso we can check if the list matches what is expected\n\n:return: The list of moderator IDs with sensitive information replaced by '*'\n:rtype: List[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'anonymized_user_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The list of user IDs with sensitive information replaced by '*'. We show the last 3 digits of the IDs,\nso we can check if the list matches what is expected\n\n:return: The list of user IDs with sensitive information replaced by '*'\n:rtype: List[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'authorized_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Set[int], alias=None, alias_priority=None, title=None, field_title_generator=None, description='The list of all authorized Telegram IDs inferred from admin, moderator and user Telegram IDs\n\n:return: A list, empty by default, of all authorized IDs as integers\n:rtype: Set[int]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'bot': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[aiogram.client.bot.Bot], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Telegram bot, typically initialized from given Telegram API token\n\n:return: The Telegram bot\n:rtype: Optional[Bot]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'bot_token': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Telegram bot API token\n\n:return: The API token for the Telegram bot\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'commands': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[aiogram.types.bot_command.BotCommand], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Telegram bot commands list\n\n:return: The list of commands for the Telegram bot\n:rtype: List[BotCommand]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'config': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[typing.Dict[str, typing.Any]], alias=None, alias_priority=None, title=None, field_title_generator=None, description='The configuration imported from the configuration file in the form of a dictionary\n\n:return: The configuration parsed from configuration file path\n:rtype: Optional[Dict[str, Any]]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'config_file': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="Path of the application's configuration file\n\n:return: The application's configuration file path\n:rtype: Optional[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'data_dir': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description="Directory path dedicated to Quackamollie's data\n\n:return: Directory path dedicated to Quackamollie's data\n:rtype: Optional[str]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_host': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'str'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Hostname of the postgres database\n\n:return: The hostname of the postgres database\n:rtype: str', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_name': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'str'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Name of the postgres database\n\n:return: The name of the postgres database\n:rtype: str', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_password': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Password for postgres database connection\n\n:return: The password for postgres database connection\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_port': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[int], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Port of the postgres database\n\n:return: The port of the postgres database\n:rtype: Optional[int]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_protocol': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'str'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Database protocol, must be a protocol supported by SQLAlchemy\n\n:return: The database protocol\n:rtype: str', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_url': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='URL of the postgres database\n\n:return: The URL of the postgres database\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'db_username': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Username for postgres database connection\n\n:return: The username for postgres database connection\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'default_model': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='The name of the model to use by default\n\n:return: The name of the model to use by default\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'default_model_config': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='The additional configuration for instantiation of the default model\n\n:return: Additional configuration of the model to use by default\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'default_model_manager': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='The name of the ModelManager to use by default\n\n:return: The name of the ModelManager to use by default\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'dispatcher': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[aiogram.dispatcher.dispatcher.Dispatcher], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Telegram dispatcher\n\n:return: The Telegram dispatcher\n:rtype: Optional[Dispatcher]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'engine': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[sqlalchemy.ext.asyncio.engine.AsyncEngine], alias=None, alias_priority=None, title=None, field_title_generator=None, description='SQLAlchemy Engine for database requests, initialized by CLI with database config\n\n:return: The SQLAlchemy Engine\n:rtype: Optional[AsyncEngine]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'history_max_length': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[int], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Maximum length of the history, in number of messages including those previously generated, to include\nwhen answering a message using a model. If None, no limit is applied during the request to the database.\n\n:return: The maximum length of the history to include when answering a message using a model\n:rtype: Optional[int]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'log_dir': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Directory path for logs\n\n:return: Directory path for logs\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'logging_config': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[typing.Dict[str, typing.Any]], alias=None, alias_priority=None, title=None, field_title_generator=None, description="The 'logging' configuration imported from the configuration file in the form of a dictionary\n\n:return: The 'logging' configuration parsed from configuration file path\n:rtype: Optional[Dict[str, Any]]", deprecated=None, examples=None, json_schema_extra=None, repr=True), 'min_nb_chunk_to_show': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'int'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Minimum number of chunks to show at the same time when streaming the answer of a model.\nA value of 10 implies trying the edition of the generated Telegram message every 10 chunks.\n\n:return: The minimum number of chunks to show at the same time when streaming the answer of a model\n:rtype: int', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'moderator_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[int], alias=None, alias_priority=None, title=None, field_title_generator=None, description='A list of moderator Telegram IDs\n\n:return: A list, empty by default, of moderator IDs as integers\n:rtype: List[int]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'ollama_base_url': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[str], alias=None, alias_priority=None, title=None, field_title_generator=None, description='Ollama base URL\n\n:return: The Ollama base URL\n:rtype: Optional[str]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'session': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.Optional[sqlalchemy.ext.asyncio.session.async_sessionmaker[sqlalchemy.ext.asyncio.session.AsyncSession]], alias=None, alias_priority=None, title=None, field_title_generator=None, description='SQLAlchemy async session maker for async database requests, initialized by CLI for use in aiogram functions\n\n:return: The SQLAlchemy async session maker\n:rtype: Optional[async_sessionmaker[AsyncSession]]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'user_ids': ComputedFieldInfo(wrapped_property=<property object>, return_type=typing.List[int], alias=None, alias_priority=None, title=None, field_title_generator=None, description='A list of user Telegram IDs\n\n:return: A list, empty by default, of user IDs as integers\n:rtype: List[int]', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'verbose': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'int'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Effective verbosity level in the same format as logging\n\n:return: The verbosity level\n:rtype: int', deprecated=None, examples=None, json_schema_extra=None, repr=True)}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'enable_settings_edition': FieldInfo(annotation=bool, required=False, default=True), 'raise_error_when_not_editable': FieldInfo(annotation=bool, required=False, default=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Args:
self: The BaseModel instance. context: The context.
- property moderator_ids: List[int]¶
A list of moderator Telegram IDs
- Returns:
A list, empty by default, of moderator IDs as integers
- Return type:
List[int]
- property ollama_base_url: str | None¶
Ollama base URL
- Returns:
The Ollama base URL
- Return type:
Optional[str]
- raise_error_when_not_editable: bool¶
- property session: async_sessionmaker[AsyncSession] | None¶
SQLAlchemy async session maker for async database requests, initialized by CLI for use in aiogram functions
- Returns:
The SQLAlchemy async session maker
- Return type:
Optional[async_sessionmaker[AsyncSession]]
- property user_ids: List[int]¶
A list of user Telegram IDs
- Returns:
A list, empty by default, of user IDs as integers
- Return type:
List[int]
- property verbose: int¶
Effective verbosity level in the same format as logging
- Returns:
The verbosity level
- Return type:
int
- quackamollie.core.cli.settings.get_settings_from_context(no_error: bool = False) QuackamollieSettings | None[source]¶
Get the current instance of QuackamollieSettings. If no_error is True, exceptions will be caught and logged, else it raises RuntimeErrors if no click context is found or if no object is defined in the click context.
- Returns:
The current instance of QuackamollieSettings
- Return type:
Optional[QuackamollieSettings]
- quackamollie.core.cli.settings.pass_quackamollie_settings(f: t.Callable[te.Concatenate[T, P], R]) t.Callable[P, R]¶