yera.config.loaders.providers
Provider config loader — reads and validates provider config from yera.toml.
Symbols
get_connection
get_connection(
connection_name: str,
provider_type: str,
provider_config: BaseProviderConfig,
) → BaseConnectionLook up a named connection from a provider config.
Parameters
Name of the connection to retrieve.
Provider type key, used in error messages.
The loaded provider config to look up from.
Returns
The matching connection object.
Raises
If no connection with the given name exists on the provider.
get_provider_config
get_provider_config(
provider_type: str,
providers: Providers,
) → BaseProviderConfigLook up a named provider from the loaded providers config.
Parameters
Provider type key, e.g. "aws", "ollama".
The loaded providers config.
Returns
The provider config for the given type.
Raises
If the provider type is not configured.
load_providers
load_providers() → Providers | NoneRead [providers] from yera.toml and build a Providers instance.
Returns an empty Providers when the section or file is absent.
Validation is eager — malformed provider config raises immediately via
Pydantic.
Returns
A Providers instance populated from yera.toml, or an empty instance if the section is absent.
Raises
If any provider entry fails Pydantic validation.
resolve_connection
resolve_connection(
provider_type: str,
provider_config: BaseProviderConfig,
active_profile: Profile,
) → strDetermine the active connection name for a provider from the Yera profile.
Looks up the connection name for the given provider type in the active Yera profile's provider map. The Yera profile is the sole source of truth for which connection is active — there is no fallback.
Parameters
Provider type key, e.g. "aws", "ollama".
The loaded provider config, used to validate that the resolved connection name actually exists.
The active Yera profile whose provider map is used for resolution.
Returns
The resolved connection name string.
Raises
If the provider type is not listed in the active Yera profile's provider map.
If the resolved connection name does not exist on the provider config.