iamai.config module¶
Configuration module.
iamai uses pydantic to read configuration.
- class iamai.config.AdapterConfig(**extra_data: Any)[source]¶
Bases:
ConfigModelAdapter configuration.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class iamai.config.BotConfig(*, plugins: ~typing.Set[str] = <factory>, plugin_dirs: ~typing.Set[~pathlib.Annotated[~pathlib.Path, ~pydantic.types.PathType(path_type=dir)]] = <factory>, adapters: ~typing.Set[str] = <factory>, locale: ~typing.Set[str] = <factory>, log: ~iamai.config.LogConfig = LogConfig(level='DEBUG', verbose_exception=False), **extra_data: ~typing.Any)[source]¶
Bases:
ConfigModelBot configuration.
- plugins¶
List of plugins to be loaded, which will be loaded by the
load_plugins()method of theBotclass.- Type:
Set[str]
- plugin_dirs¶
List of plugin directories to be loaded, which will be loaded by the
load_plugins_from_dirs()method of theBotclass.- Type:
Set[Annotated[pathlib.Path, pydantic.types.PathType(path_type=dir)]]
- adapters¶
A list of adapters to be loaded, which will be loaded in turn by the
load_adapters()method of theBotclass.- Type:
Set[str]
- log¶
iamai log related settings.
- Type:
- adapters: Set[str]¶
- locale: Set[str]¶
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- plugin_dirs: Set[Annotated[Path, PathType(path_type=dir)]]¶
- plugins: Set[str]¶
- class iamai.config.ConfigModel(**extra_data: Any)[source]¶
Bases:
BaseModeliamai configuration model.
- __config_name__¶
Configuration name.
- Type:
str
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class iamai.config.LogConfig(*, level: str | int = 'DEBUG', verbose_exception: bool = False, **extra_data: Any)[source]¶
Bases:
ConfigModeliamai log related settings.
- level¶
log level.
- Type:
str | int
- verbose_exception¶
Detailed exception record. When set to
True, exception Traceback will be added to the log.- Type:
bool
- level: str | int¶
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- verbose_exception: bool¶
- class iamai.config.MainConfig(*, bot: BotConfig = BotConfig(plugins=set(), plugin_dirs=set(), adapters=set(), locale=set(), log=LogConfig(level='DEBUG', verbose_exception=False)), plugin: PluginConfig = PluginConfig(), adapter: AdapterConfig = AdapterConfig(), **extra_data: Any)[source]¶
Bases:
ConfigModeliamai configuration.
- bot¶
the main configuration of iamai.
- Type:
- adapter: AdapterConfig¶
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- plugin: PluginConfig¶
- class iamai.config.PluginConfig(**extra_data: Any)[source]¶
Bases:
ConfigModelPlugin configuration.
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].