Merge pull request #147 from GustavoWidman/rustls-fix

ensure rustls is used when feature is activated
This commit is contained in:
Dongri Jin
2025-02-02 17:34:47 +09:00
committed by GitHub

View File

@@ -136,6 +136,9 @@ impl OpenAIClient {
let url = format!("{}/{}", self.api_endpoint, path); let url = format!("{}/{}", self.api_endpoint, path);
let client = Client::builder(); let client = Client::builder();
#[cfg(feature = "rustls")]
let client = client.use_rustls_tls();
let client = if let Some(timeout) = self.timeout { let client = if let Some(timeout) = self.timeout {
client.timeout(std::time::Duration::from_secs(timeout)) client.timeout(std::time::Duration::from_secs(timeout))
} else { } else {