Skip to content

Commit e511245

Browse files
committed
[fix] scope the base_url trailing-slash normalization to OpenAI-compatible backend
1 parent 0eca58b commit e511245

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/providers/openai_compatible.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl<T: OpenAIProviderConfig> OpenAICompatibleProvider<T> {
327327
};
328328
Self {
329329
api_key: api_key.into(),
330-
base_url: Url::parse(&base_url.unwrap_or_else(|| T::DEFAULT_BASE_URL.to_owned()))
330+
base_url: Url::parse(&format!("{}/", base_url.unwrap_or_else(|| T::DEFAULT_BASE_URL.to_owned()).trim_end_matches("/")))
331331
.expect("Failed to parse base URL"),
332332
model: model.unwrap_or_else(|| T::DEFAULT_MODEL.to_string()),
333333
max_tokens,

0 commit comments

Comments
 (0)