elph-ai 0.0.26

Unified LLM API with provider collections, auth resolution, and streaming
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::types::ProviderEnv;

pub fn get_provider_env_value(key: &str, env: Option<&ProviderEnv>) -> Option<String> {
    if let Some(env) = env
        && let Some(v) = env.get(key)
    {
        return Some(v.clone());
    }
    std::env::var(key).ok()
}