mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 15:15:34 +00:00
shorthand for api key in the query string
This commit is contained in:
@ -168,11 +168,8 @@ impl OpenAIClient {
|
||||
|
||||
let mut request = client.request(method, url);
|
||||
|
||||
if self.api_key.is_some() {
|
||||
request = request.header(
|
||||
"Authorization",
|
||||
format!("Bearer {}", self.api_key.as_ref().unwrap()),
|
||||
);
|
||||
if let Some(api_key) = &self.api_key {
|
||||
request = request.header("Authorization", format!("Bearer {}", api_key));
|
||||
}
|
||||
|
||||
if let Some(organization) = &self.organization {
|
||||
|
Reference in New Issue
Block a user