We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f5ecd2 commit 2068765Copy full SHA for 2068765
src/v1/api.rs
@@ -141,12 +141,12 @@ impl OpenAIClient {
141
}
142
143
async fn build_request(&self, method: Method, path: &str) -> reqwest::RequestBuilder {
144
- let url = format!(
145
- "{}/{}?api-version={}",
146
- self.api_endpoint,
147
- path,
148
- self.api_version.as_deref().unwrap_or("v1")
149
- );
+ let mut url = format!("{}/{}", self.api_endpoint, path);
+
+ if self.api_version.is_some() {
+ let api_version = self.api_version.as_ref().unwrap();
+ url = format!("{}?api-version={}", url, api_version);
+ }
150
151
let client = Client::builder();
152
0 commit comments