64bit / async-openai

Rust library for OpenAI
https://docs.rs/async-openai
MIT License
1.17k stars 178 forks source link

chore: add with_headers method #245

Open b0xtch opened 3 months ago

b0xtch commented 3 months ago

Support custom headers required for observability applications

    let client = Client::with_config(
        OpenAIConfig::default()
            .with_api_base(api_base)
            .with_headers(HashMap::from([(
                "Helicone-Auth".to_string(),
                format!("Bearer {}", config_env_var("HELICONE_API_KEY")?),
            )])),
    );
64bit commented 3 months ago

Thanks for the PR, I'll leave review seperately