pub fn resolve_api_key(
api_key: Option<&str>,
provider: Provider,
) -> (Option<String>, ApiKeySource)Expand description
Resolve API key from config or environment variable.
Resolution order:
- If
api_keyisSomeand non-empty, use it (from config) - Otherwise, check the provider’s environment variable
- If neither has a key, returns
None(caller will usefrom_env())
Note: An empty string in config is treated as “not configured” and falls back to the environment variable. This allows users to override env vars in config while still supporting env-only setups.