Extensions¶
zelos_sdk.extensions loads an extension's configuration.
Import what you need from it, for example from zelos_sdk.extensions import load_config.
Extension configuration utilities for Zelos SDK.
ConfigError
¶
Bases: RuntimeError
Configuration loading error.
ConfigValidationError(message, *, errors=None, field_errors=None)
¶
Bases: ConfigError
Configuration validation error.
Attributes:
| Name | Type | Description |
|---|---|---|
errors |
List of error messages |
|
field_errors |
Dict mapping field paths to errors |
load_config(*, config_path='config.json', schema_path='config.schema.json', overrides=None)
¶
Load and validate extension configuration.
Loads config and schema files from current directory, applies defaults, validates, and merges overrides.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str | Path
|
Config file path (default: "config.json") |
'config.json'
|
schema_path
|
str | Path
|
Schema file path (default: "config.schema.json") |
'config.schema.json'
|
overrides
|
dict[str, Any] | None
|
Runtime overrides to merge (optional) |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Merged configuration dictionary with defaults applied |
A missing config file reads as {}. A missing schema file skips
defaults and validation.
Raises:
| Type | Description |
|---|---|
ConfigValidationError
|
If validation fails |
JSONDecodeError
|
If a file contains invalid JSON |
Examples: