Skip to main content

build_provider

Function build_provider 

Source
pub fn build_provider(
    path: PathBuf,
    catalog: ProviderCatalog,
    env_prefix: &str,
) -> Option<Arc<dyn Provider>>
Expand description

Builds the concrete adapter for catalog’s declared kind.

env_prefix is the product’s env-namespace (e.g. "SOMA"), forwarded to the ai-sdk and python adapters’ EnvRequirement resolution.

Returns None when the crate was not built with the feature that owns catalog’s kind. Every ProviderKind has a matching adapter here, feature-gated per plan section 3.9 (“Do not over-split”) so a consumer only pays for the runtimes it actually drop-in-loads.