mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +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);
|
let mut request = client.request(method, url);
|
||||||
|
|
||||||
if self.api_key.is_some() {
|
if let Some(api_key) = &self.api_key {
|
||||||
request = request.header(
|
request = request.header("Authorization", format!("Bearer {}", api_key));
|
||||||
"Authorization",
|
|
||||||
format!("Bearer {}", self.api_key.as_ref().unwrap()),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(organization) = &self.organization {
|
if let Some(organization) = &self.organization {
|
||||||
|
Reference in New Issue
Block a user