llm-connector 1.0.3

Next-generation Rust library for LLM protocol abstraction with native multi-modal support. Supports 12+ providers (OpenAI, Anthropic, Google, Aliyun, Zhipu, Ollama, Tencent, Volcengine, LongCat, Moonshot, DeepSeek, Xiaomi) with clean Protocol/Provider separation, type-safe interface, and universal streaming.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Common Authentication Strategies

/// Create standard Bearer token header
pub fn bearer_auth(api_key: &str) -> Vec<(String, String)> {
    vec![
        ("Authorization".to_string(), format!("Bearer {}", api_key)),
        ("Content-Type".to_string(), "application/json".to_string()),
    ]
}

/// Create standard API Key header (e.g. for Anthropic)
pub fn api_key_header(api_key: &str, header_name: &str) -> Vec<(String, String)> {
    vec![
        (header_name.to_string(), api_key.to_string()),
        ("Content-Type".to_string(), "application/json".to_string()),
    ]
}